Files
nix/hosts/common/configs/system/sops/default.nix
2025-05-13 11:03:09 +01:00

30 lines
571 B
Nix

{
config,
inputs,
pkgs,
...
}:
{
imports = [ inputs.sops-nix.nixosModules.sops ];
environment = {
persistence."/persist"."/etc/ssh/ssh_host_ed25519_key" = { };
systemPackages = with pkgs; [
sops
age
ssh-to-age
];
};
sops = {
defaultSopsFile = ../../../../. + "/${config.networking.hostName}/secrets/secrets.yaml";
age = {
generateKey = true;
sshKeyPaths = [ config.environment.persistence."/persist"."/etc/ssh/ssh_host_ed25519_key".source ];
keyFile = "/var/lib/sops-nix/key.txt";
};
};
}