diff options
author | Matt Layher <mdlayher@gmail.com> | 2020-12-29 15:15:32 -0500 |
---|---|---|
committer | Matt Layher <mdlayher@gmail.com> | 2020-12-29 17:47:01 -0500 |
commit | 071c02a4b226f2a33fb6608e7660b1ec80af6d14 (patch) | |
tree | bd02592cdad4fa6883d856963dd2cd0489f2d265 /nixos/modules/services/networking/corerad.nix | |
parent | 09b571cfe79cb6af393a022a7659ce2bcc6e02bc (diff) | |
download | nixpkgs-071c02a4b226f2a33fb6608e7660b1ec80af6d14.tar nixpkgs-071c02a4b226f2a33fb6608e7660b1ec80af6d14.tar.gz nixpkgs-071c02a4b226f2a33fb6608e7660b1ec80af6d14.tar.bz2 nixpkgs-071c02a4b226f2a33fb6608e7660b1ec80af6d14.tar.lz nixpkgs-071c02a4b226f2a33fb6608e7660b1ec80af6d14.tar.xz nixpkgs-071c02a4b226f2a33fb6608e7660b1ec80af6d14.tar.zst nixpkgs-071c02a4b226f2a33fb6608e7660b1ec80af6d14.zip |
nixos/corerad: use pkgs.formats.toml to generate TOML configuration
Signed-off-by: Matt Layher <mdlayher@gmail.com>
Diffstat (limited to 'nixos/modules/services/networking/corerad.nix')
-rw-r--r-- | nixos/modules/services/networking/corerad.nix | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/nixos/modules/services/networking/corerad.nix b/nixos/modules/services/networking/corerad.nix index d90a5923bc6..4acdd1d69cc 100644 --- a/nixos/modules/services/networking/corerad.nix +++ b/nixos/modules/services/networking/corerad.nix @@ -4,13 +4,7 @@ with lib; let cfg = config.services.corerad; - - writeTOML = name: x: - pkgs.runCommandNoCCLocal name { - passAsFile = ["config"]; - config = builtins.toJSON x; - buildInputs = [ pkgs.go-toml ]; - } "jsontoml < $configPath > $out"; + settingsFormat = pkgs.formats.toml {}; in { meta.maintainers = with maintainers; [ mdlayher ]; @@ -19,7 +13,7 @@ in { enable = mkEnableOption "CoreRAD IPv6 NDP RA daemon"; settings = mkOption { - type = types.uniq types.attrs; + type = settingsFormat.type; example = literalExample '' { interfaces = [ @@ -64,7 +58,7 @@ in { config = mkIf cfg.enable { # Prefer the config file over settings if both are set. - services.corerad.configFile = mkDefault (writeTOML "corerad.toml" cfg.settings); + services.corerad.configFile = mkDefault (settingsFormat.generate "corerad.toml" cfg.settings); systemd.services.corerad = { description = "CoreRAD IPv6 NDP RA daemon"; |