nixos/hosts/common/core/sops.nix

28 lines
615 B
Nix
Raw Normal View History

2024-05-23 10:48:00 +01:00
{ pkgs, inputs, config, username, ... }:
2024-05-12 19:58:55 +01:00
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-23 13:19:21 +01:00
hostname = config.networking.hostName;
2024-05-12 19:58:55 +01:00
in
{
imports = [
inputs.sops-nix.nixosModules.sops
];
sops = {
defaultSopsFile = "${secretsFile}";
validateSopsFiles = false;
2024-05-19 23:33:42 +01:00
age = {
2024-05-24 14:01:19 +01:00
sshKeyPaths = [ "/persist/etc/ssh/ssh_host_ed25519_key" ];
};
2024-05-23 10:48:00 +01:00
secrets = {
"passwords/root".neededForUsers = true;
"ssh_keys/deploy_key/id_ed25519" = {
path = "/etc/ssh/deploy_key-ssh-ed25519";
};
};
2024-05-12 19:58:55 +01:00
};
}