network/nix/lib/config/salt-support/load-yaml.nix
Astro 1e0201b429 config: remove yaml-gpg.rb again
this approach required the gpg privkey all time
2021-04-11 02:02:15 +02:00

18 lines
334 B
Nix

{ pkgs ? import <nixpkgs> {}
}:
path:
let
json = pkgs.runCommandLocal "desalinated-${builtins.baseNameOf path}" {
nativeBuildInputs = with pkgs; [
pythonPackages.j2cli ruby yaml2json
];
} ''
j2 ${path} > expanded.yaml
yaml2json < expanded.yaml > $out
'';
in
builtins.fromJSON (
builtins.readFile json
)