refactor: move sops module to base dir

This commit is contained in:
tux
2025-02-22 11:15:56 +05:30
parent 29bd3485ca
commit e295b7039f
3 changed files with 1 additions and 1 deletions

20
modules/base/sops.nix Normal file
View File

@ -0,0 +1,20 @@
{
inputs,
config,
pkgs,
...
}: let
isEd25519 = k: k.type == "ed25519";
getKeyPath = k: k.path;
keys = builtins.filter isEd25519 config.services.openssh.hostKeys;
in {
imports = [inputs.sops-nix.nixosModules.sops];
sops.age = {
sshKeyPaths = map getKeyPath keys;
keyFile = "/var/lib/sops-nix/key.txt";
generateKey = true;
};
environment.systemPackages = with pkgs; [sops];
}