feat(nixos): add user password secrets to sops

This commit adds the user password secrets to sops.
It leverages the `userListToAttrs` lib function.
This commit is contained in:
Mohammad Rafiq 2025-07-07 17:26:57 +08:00
parent 782a4324a8
commit 4ff7b8e18f
No known key found for this signature in database
5 changed files with 42 additions and 15 deletions

View file

@ -16,12 +16,9 @@ in
{ config, ... }:
{
imports = [ inputs.sops-nix.nixosModules.sops ];
config.sops = {
defaultSopsFile = "${cfg.root}/secrets/secrets.yaml";
age.sshKeyPaths = [
"/persist${config.users.defaultUserHome}/${username}/.ssh/id_ed25519"
];
};
config.sops.age.sshKeyPaths = [
"/persist${config.users.defaultUserHome}/${username}/.ssh/id_ed25519"
];
};
perSystem =
{ pkgs, ... }: