about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorMatt Layher <mdlayher@gmail.com>2020-06-14 13:30:17 -0400
committerMatt Layher <mdlayher@gmail.com>2020-06-14 13:30:17 -0400
commit562beabff3e24062a7b62843644f2c90cddc691e (patch)
tree792f6742c790a459287cb7b92b010cf9daed9a97 /nixos
parent13231517a293eb0b835d1e12dffceeffdb1d472d (diff)
downloadnixlib-562beabff3e24062a7b62843644f2c90cddc691e.tar
nixlib-562beabff3e24062a7b62843644f2c90cddc691e.tar.gz
nixlib-562beabff3e24062a7b62843644f2c90cddc691e.tar.bz2
nixlib-562beabff3e24062a7b62843644f2c90cddc691e.tar.lz
nixlib-562beabff3e24062a7b62843644f2c90cddc691e.tar.xz
nixlib-562beabff3e24062a7b62843644f2c90cddc691e.tar.zst
nixlib-562beabff3e24062a7b62843644f2c90cddc691e.zip
nixos/corerad: use passAsFile while converting settings JSON to TOML
Signed-off-by: Matt Layher <mdlayher@gmail.com>
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/networking/corerad.nix8
1 files changed, 5 insertions, 3 deletions
diff --git a/nixos/modules/services/networking/corerad.nix b/nixos/modules/services/networking/corerad.nix
index 2d4d414aae10..5d73c0a0d779 100644
--- a/nixos/modules/services/networking/corerad.nix
+++ b/nixos/modules/services/networking/corerad.nix
@@ -6,9 +6,11 @@ let
   cfg = config.services.corerad;
 
   writeTOML = name: x:
-    pkgs.runCommandNoCCLocal name { } ''
-      echo '${builtins.toJSON x}' | ${pkgs.go-toml}/bin/jsontoml > $out
-    '';
+    pkgs.runCommandNoCCLocal name {
+      passAsFile = ["config"];
+      config = builtins.toJSON x;
+      buildInputs = [ pkgs.go-toml ];
+    } "jsontoml < $configPath > $out";
 
 in {
   meta.maintainers = with maintainers; [ mdlayher ];