nixos/modules/sops.nix
2024-05-21 17:35:42 -04:00

23 lines
458 B
Nix

{
sops-nix,
self,
_file,
}:
{
pkgs,
config,
lib,
...
}:
{
imports = [ sops-nix.nixosModules.sops ];
options.local.sops.disable = lib.mkEnableOption "";
config = lib.mkIf (!config.local.sops.disable) {
environment.systemPackages = [ pkgs.sops ];
sops = {
defaultSopsFile = "${self}/hosts/${config.networking.hostName}/secrets.yaml";
age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
};
};
inherit _file;
}