infrastructure/packages/sops/default.nix
Fabian Hauser 15ece3585e
All checks were successful
CI / build (push) Successful in 2m46s
Migrate packages to use callPackage pattern
2024-10-19 20:00:52 +03:00

21 lines
431 B
Nix

{
gitMinimal,
nix,
sops,
writeShellApplication,
...
}:
writeShellApplication {
name = "sops";
meta.description = "Run SOPS with the generated configuration";
runtimeInputs = [
sops
gitMinimal
nix
];
text = ''
FLAKE_ROOT="$(git rev-parse --show-toplevel)"
nix build --out-link "$FLAKE_ROOT/.sops.yaml" "$FLAKE_ROOT#sops-config"
sops --config "''${FLAKE_ROOT}/.sops.yaml" "''${@}"
'';
}