nixos/home/common/optional/sops.nix

29 lines
686 B
Nix

{ inputs, config, ... }:
let
secretsDirectory = builtins.toString inputs.nix-secrets;
secretsFile = "${secretsDirectory}/secrets.yaml";
homeDirectory = config.home.homeDirectory;
username = config.home.username;
in
{
imports = [
inputs.sops-nix.homeManagerModules.sops
];
sops = {
age = {
sshKeyPaths = [ "${homeDirectory}/.ssh/id_ed25519" ];
generateKey = true;
keyFile = "/home/${username}/.config/sops/age/keys.txt";
};
defaultSopsFile = "${secretsFile}";
validateSopsFiles = false;
secrets = {
"ssh_keys/deploy_key/id_ed25519" = {
path = "/home/${username}/.ssh/deploy_key-ssh-ed25519";
};
};
};
}