deploy: Make secrets deployment optional

This commit is contained in:
Simon Bruder 2021-01-06 23:45:29 +01:00
parent 2b6a7bc1f6
commit f1620679d4
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC

View file

@ -8,11 +8,12 @@ let
kropsDeploy = kropsDeploy =
{ hostname { hostname
, target ? null , target ? null
, secrets ? true
, extraSources ? { } , extraSources ? { }
}: }:
let let
source = lib.evalSource [ source = lib.evalSource [
({ {
nixpkgs.git = { nixpkgs.git = {
ref = sources.nixpkgs.rev; ref = sources.nixpkgs.rev;
url = https://github.com/NixOS/nixpkgs; url = https://github.com/NixOS/nixpkgs;
@ -32,11 +33,14 @@ let
]; ];
}; };
nixos-config.symlink = "config/machines/${hostname}/configuration.nix"; nixos-config.symlink = "config/machines/${hostname}/configuration.nix";
}
(lib.mkIf secrets {
secrets.pass = { secrets.pass = {
dir = toString ~/.password-store; dir = toString ~/.password-store;
name = "nixos/machines/${hostname}"; name = "nixos/machines/${hostname}";
}; };
} // extraSources) })
extraSources
]; ];
in in
kropsPkgs.krops.writeDeploy "deploy-${hostname}" { kropsPkgs.krops.writeDeploy "deploy-${hostname}" {