Add xdg settings, cache, cleanup script

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-06-21 23:39:18 +03:00
parent ce37f320c2
commit 48f391e3ad
22 changed files with 245 additions and 51 deletions

View File

@@ -1,6 +1,8 @@
{ user ? throw "user argument is required" }: { pkgs, ... }:
{ user ? throw "user argument is required" }: { config, pkgs, ... }:
{
let
hmConfig = config.home-manager.users."${user.name}";
in {
home-manager.users."${user.name}" = {
programs.git = {
enable = true;
@@ -14,7 +16,7 @@
extraConfig.credential.helper = "store";
hooks = let
commit-msg-hook = pkgs.writeShellScriptBin "git-commit-msg" ''
git interpret-trailers --if-exists doNothing --trailer \
${pkgs.git}/bin/git interpret-trailers --if-exists doNothing --trailer \
"Signed-off-by: $(git config user.name) <$(git config user.email)>" \
--in-place "$1"
'';
@@ -22,5 +24,7 @@
commit-msg = "${commit-msg-hook}/bin/git-commit-msg";
};
};
sops.secrets."git".path = "${hmConfig.xdg.configHome}/git/credentials";
};
}