diff options
| author | Arpit Chakladar <arpitchakladar@proton.me> | 2026-07-09 00:08:45 +0530 |
|---|---|---|
| committer | Arpit Chakladar <arpitchakladar@proton.me> | 2026-07-09 00:08:45 +0530 |
| commit | 0279e3b3f34d7f29a6e6c7d499873d1f6a889a34 (patch) | |
| tree | 61a873ae1635b1c54fc63d79acc95bd108207163 /modules/programs/git/default.nix | |
| parent | 53d893cde30b11388ba77b904ee9a406c3e879ae (diff) | |
| download | home-manager-config-0279e3b3f34d7f29a6e6c7d499873d1f6a889a34.tar.gz home-manager-config-0279e3b3f34d7f29a6e6c7d499873d1f6a889a34.zip | |
feat: added aerc (email client), pass (password manager), gpg (encryption manager)
Using aerc email client with imap and smtp with mbsync to download the mail locally and notmuch to query it
Added custom scripts to automatically add email configurations for popular email providers for mbsync
Using pass password manager with gpg for encryption
Using git with pass instead of storing the github token in a plain-text file
Diffstat (limited to 'modules/programs/git/default.nix')
| -rw-r--r-- | modules/programs/git/default.nix | 41 |
1 files changed, 27 insertions, 14 deletions
diff --git a/modules/programs/git/default.nix b/modules/programs/git/default.nix index 24d63c7..cfba093 100644 --- a/modules/programs/git/default.nix +++ b/modules/programs/git/default.nix @@ -1,6 +1,15 @@ -{ lib, config, ... }: +{ + config, + lib, + pkgs, + ... +}: # Git - Distributed version control system +let + passCfg = config.programs.pass; + passGitHelper = lib.getExe pkgs.pass-git-helper; +in { options.programs.git = { username = lib.mkOption { @@ -15,19 +24,23 @@ config = lib.mkIf config.programs.git.enable { programs.git = { - settings = { - user = { - name = config.programs.git.username; - email = config.programs.git.email; - }; - credential.helper = "store --file ${config.xdg.cacheHome}/git/credential"; - core.askPass = ""; - }; + settings = + lib.recursiveUpdate + { + user = { + name = config.programs.git.username; + email = config.programs.git.email; + }; + core.askPass = ""; + } + ( + lib.optionalAttrs passCfg.enable { + credential."https://github.com" = { + username = passCfg.github.username; + helper = passGitHelper; + }; + } + ); }; - - # The base directory of the credential file must exist - home.activation.createGitCacheDirectory = lib.hm.dag.entryAfter [ - "writeBoundary" - ] "mkdir -p ${config.xdg.cacheHome}/git"; }; } |
