Avoid possible infinite recursion

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-07-16 17:46:58 +03:00
parent df781012fd
commit 566b4e0157
38 changed files with 216 additions and 187 deletions

View File

@@ -1,5 +1,5 @@
{
user ? throw "user argument is required",
username ? throw "username argument is required",
}:
{
config,
@@ -8,17 +8,18 @@
...
}:
let
userConfig = config.users.users.${username};
sopsKeyPath = ".config/sops-nix/key.txt";
in
{
home-manager.users.${user.name} = {
home-manager.users.${username} = {
imports = [ inputs.sops-nix.homeManagerModules.sops ];
sops.age.keyFile = "/persist${user.home}/${sopsKeyPath}";
sops.age.keyFile = "/persist${userConfig.home}/${sopsKeyPath}";
home = {
persistence."/persist${user.home}".files = [ sopsKeyPath ];
sessionVariables.SOPS_AGE_KEY_FILE = "${user.home}/${sopsKeyPath}";
persistence."/persist${userConfig.home}".files = [ sopsKeyPath ];
sessionVariables.SOPS_AGE_KEY_FILE = "${userConfig.home}/${sopsKeyPath}";
};
};
}