feat: Move home.nix into this repo
This makes it much easier to test and apply changes.
This commit is contained in:
parent
9b1fb2432a
commit
b3b4b78660
10 changed files with 703 additions and 224 deletions
30
home/users.nix
Normal file
30
home/users.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
inherit (config) jhome;
|
||||
inherit (cfg.defaultIdentity) gpgKey;
|
||||
|
||||
cfg = jhome.user;
|
||||
hasConfig = jhome.enable && cfg != null;
|
||||
hasKey = gpgKey != null;
|
||||
gpgHome = config.programs.gpg.homedir;
|
||||
unlockKey = hasConfig && cfg.unlockGpgKeyOnLogin && hasKey;
|
||||
in
|
||||
{
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf hasConfig {
|
||||
programs.git.userName = cfg.defaultIdentity.name;
|
||||
programs.git.userEmail = cfg.defaultIdentity.email;
|
||||
programs.git.signing = lib.mkIf hasKey {
|
||||
signByDefault = true;
|
||||
key = gpgKey;
|
||||
};
|
||||
})
|
||||
(lib.mkIf unlockKey {
|
||||
xdg.configFile.pam-gnupg.text = ''
|
||||
${gpgHome}
|
||||
|
||||
${gpgKey}
|
||||
'';
|
||||
})
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue