nixos/hosts/common/core/sops.nix

30 lines
672 B
Nix
Raw Permalink Normal View History

{
lib,
inputs,
config,
...
}: let
2024-05-14 14:51:09 +01:00
secretsDirectory = builtins.toString inputs.nix-secrets;
2024-05-12 19:58:55 +01:00
secretsFile = "${secretsDirectory}/secrets.yaml";
2024-05-25 18:34:37 +01:00
hasOptinPersistence = config.environment.persistence ? "/persist";
in {
2024-05-12 19:58:55 +01:00
imports = [
inputs.sops-nix.nixosModules.sops
];
sops = {
defaultSopsFile = "${secretsFile}";
validateSopsFiles = false;
2024-05-19 23:33:42 +01:00
age = {
sshKeyPaths = ["${lib.optionalString hasOptinPersistence "/persist"}/etc/ssh/ssh_host_ed25519_key"];
};
2024-06-17 20:20:33 +01:00
secrets = {
"passwords/root".neededForUsers = true;
2024-07-20 16:14:09 +01:00
"ssh_keys/deploy_key/id_ed25519" = {
path = "/etc/ssh/deploy_key-ssh-ed25519";
};
2024-05-23 10:48:00 +01:00
};
2024-05-12 19:58:55 +01:00
};
}