feat: configure sops

Signed-off-by: Lander Van den Bulcke <landervandenbulcke@gmail.com>
This commit is contained in:
Lander Van den Bulcke 2024-08-29 10:02:38 +02:00
parent ca89fcd828
commit 7220043169
Signed by: lander
GPG key ID: 0142722B4B0C536F
3 changed files with 29 additions and 1 deletions

13
.sops.yaml Normal file
View file

@ -0,0 +1,13 @@
keys:
- &users:
- &lander 4BE1257015580BAB9F4B9D5FCA5B1C34E649BF92
- &hosts:
- &wodan age15m0pdv8mkt4aue8wjay9k4endyymtka5je3gc2t63dgamfzh9vts7774hh
creation_rules:
- path_regex: hosts/common/secrets.yam?l$
key_groups:
- age:
- *wodan
pgp:
- *lander

View file

@ -8,12 +8,12 @@
imports = [
inputs.home-manager.nixosModules.home-manager
inputs.lix-module.nixosModules.default
inputs.sops-nix.nixosModules.sops
inputs.catppuccin.nixosModules.catppuccin
./locale.nix
./nh.nix
./openssh.nix
./sops.nix
];
home-manager.useGlobalPkgs = true;

View file

@ -0,0 +1,15 @@
{ inputs, config, ... }:
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;
};
}