Move some (all) files around
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
3
hosts/common/user/configs/console/git/commit-msg.sh
Normal file
3
hosts/common/user/configs/console/git/commit-msg.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
git interpret-trailers --if-exists doNothing --trailer \
|
||||
"Signed-off-by: $(git config user.name) <$(git config user.email)>" \
|
||||
--in-place "$1"
|
44
hosts/common/user/configs/console/git/default.nix
Normal file
44
hosts/common/user/configs/console/git/default.nix
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
user ? throw "user argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
hmConfig = config.home-manager.users.${user.name};
|
||||
in
|
||||
{
|
||||
home-manager.users.${user.name} = {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
lfs.enable = true;
|
||||
userName = user.fullName;
|
||||
userEmail = user.email;
|
||||
|
||||
signing = {
|
||||
signByDefault = true;
|
||||
key = null;
|
||||
};
|
||||
|
||||
extraConfig = {
|
||||
credential.helper = "store";
|
||||
push.autoSetupRemote = true;
|
||||
};
|
||||
|
||||
hooks = {
|
||||
commit-msg = lib.meta.getExe (
|
||||
pkgs.writeShellApplication {
|
||||
name = "git-commit-msg-hook";
|
||||
runtimeInputs = with pkgs; [ git ];
|
||||
text = builtins.readFile ./commit-msg.sh;
|
||||
}
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
sops.secrets."git".path = "${hmConfig.xdg.configHome}/git/credentials";
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user