Avoid possible infinite recursion
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{
|
||||
user ? throw "user argument is required",
|
||||
username ? throw "username argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
@@ -8,11 +8,12 @@
|
||||
...
|
||||
}:
|
||||
let
|
||||
hmConfig = config.home-manager.users.${user.name};
|
||||
userConfig = config.users.users.${username};
|
||||
hmConfig = config.home-manager.users.${username};
|
||||
gpgPath = "${hmConfig.xdg.dataHome}/gnupg";
|
||||
in
|
||||
{
|
||||
home-manager.users.${user.name} = {
|
||||
home-manager.users.${username} = {
|
||||
programs.gpg = {
|
||||
enable = true;
|
||||
homedir = gpgPath;
|
||||
@@ -37,7 +38,7 @@ in
|
||||
];
|
||||
runtimeEnv = {
|
||||
GNUPGHOME = gpgPath;
|
||||
HOME = user.home;
|
||||
HOME = userConfig.home;
|
||||
};
|
||||
text = builtins.readFile ./import-gpg-keys.sh;
|
||||
}
|
||||
@@ -64,7 +65,7 @@ in
|
||||
Install.WantedBy = [ "default.target" ];
|
||||
};
|
||||
|
||||
tmpfiles.rules = [ "d ${gpgPath} 0700 ${user.name} users -" ];
|
||||
tmpfiles.rules = [ "d ${gpgPath} 0700 ${username} users -" ];
|
||||
};
|
||||
|
||||
sops.secrets = {
|
||||
|
Reference in New Issue
Block a user