Files
nix/hosts/common/configs/system/sops/default.nix
2025-05-26 11:47:21 +01:00

32 lines
597 B
Nix

{
config,
inputs,
pkgs,
...
}:
{
imports = [ inputs.sops-nix.nixosModules.sops ];
environment = {
persistence."/persist/state"."/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/state"."/etc/ssh/ssh_host_ed25519_key".source
];
keyFile = "/var/lib/sops-nix/key.txt";
};
};
}