Skip to content

Commit

Permalink
nixos/corerad: use passAsFile while converting settings JSON to TOML
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Layher <mdlayher@gmail.com>
  • Loading branch information
mdlayher committed Jun 14, 2020
1 parent 1323151 commit 562beab
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions nixos/modules/services/networking/corerad.nix
Expand Up @@ -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 ];
Expand Down

0 comments on commit 562beab

Please sign in to comment.