Add custom impermanence module
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
{
|
||||
username ? throw "username argument is required",
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
@@ -7,16 +8,11 @@
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
userConfig = config.users.users.${username};
|
||||
hmConfig = config.home-manager.users.${username};
|
||||
gpgPath = "${hmConfig.xdg.dataHome}/gnupg";
|
||||
in
|
||||
{
|
||||
home-manager.users.${username} = {
|
||||
home-manager.users.${user} = {
|
||||
programs.gpg = {
|
||||
enable = true;
|
||||
homedir = gpgPath;
|
||||
homedir = "${home}/.local/share/gnupg";
|
||||
};
|
||||
|
||||
services.gpg-agent = {
|
||||
@@ -37,8 +33,8 @@ in
|
||||
gnupg
|
||||
];
|
||||
runtimeEnv = {
|
||||
GNUPGHOME = gpgPath;
|
||||
HOME = userConfig.home;
|
||||
GNUPGHOME = "${home}/.local/share/gnupg";
|
||||
HOME = home;
|
||||
};
|
||||
text = builtins.readFile ./import-gpg-keys.sh;
|
||||
}
|
||||
@@ -67,7 +63,7 @@ in
|
||||
Install.WantedBy = [ "default.target" ];
|
||||
};
|
||||
|
||||
tmpfiles.rules = [ "d ${gpgPath} 0700 ${username} users -" ];
|
||||
tmpfiles.rules = [ "d ${home}/.local/share/gnupg 0700 ${user} users -" ];
|
||||
};
|
||||
|
||||
sops.secrets = {
|
||||
|
Reference in New Issue
Block a user