Add custom impermanence module

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-08-08 22:03:15 +03:00
parent 5e57d63a54
commit 22e0150a65
69 changed files with 777 additions and 494 deletions

View File

@@ -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 = {