feat: no more home-manager secrets on nixos hosts

This commit is contained in:
Leon Schwarzäugl 2025-07-22 00:59:55 +02:00
parent 708d65d696
commit d7f27943a5
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
7 changed files with 71 additions and 38 deletions

View file

@ -0,0 +1,22 @@
{ lib, config, ... }:
let
inherit (config.swarselsystems) mainUser xdgDir homeDir;
modules = config.home-manager.users.${mainUser}.swarselmodules;
in
{
config = lib.mkIf config.swarselsystems.withHomeManager {
sops.secrets = (lib.optionalAttrs modules.mail
{
address1-token = { path = "${xdgDir}/secrets/address1-token"; owner = mainUser; };
address2-token = { path = "${xdgDir}/secrets/address2-token"; owner = mainUser; };
address3-token = { path = "${xdgDir}/secrets/address3-token"; owner = mainUser; };
address4-token = { path = "${xdgDir}/secrets/address4-token"; owner = mainUser; };
}) // (lib.optionalAttrs modules.waybar {
github-notifications-token = { path = "${xdgDir}/secrets/github-notifications-token"; owner = mainUser; };
}) // (lib.optionalAttrs modules.emacs {
fever-pw = { path = "${homeDir}/.emacs.d/.fever"; owner = mainUser; };
}) // (lib.optionalAttrs modules.zsh {
croc-password = { path = "${xdgDir}/secrets/croc-password"; owner = mainUser; };
});
};
}