Add basic theme config
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
3
users/configs/git/commit-msg.sh
Normal file
3
users/configs/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"
|
@@ -2,7 +2,8 @@
|
||||
|
||||
let
|
||||
hmConfig = config.home-manager.users."${user.name}";
|
||||
in {
|
||||
in
|
||||
{
|
||||
home-manager.users."${user.name}" = {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
@@ -14,14 +15,13 @@ in {
|
||||
key = null;
|
||||
};
|
||||
extraConfig.credential.helper = "store";
|
||||
hooks = let
|
||||
commit-msg-hook = pkgs.writeShellScriptBin "git-commit-msg" ''
|
||||
${pkgs.git}/bin/git interpret-trailers --if-exists doNothing --trailer \
|
||||
"Signed-off-by: $(git config user.name) <$(git config user.email)>" \
|
||||
--in-place "$1"
|
||||
'';
|
||||
in {
|
||||
commit-msg = "${commit-msg-hook}/bin/git-commit-msg";
|
||||
hooks = {
|
||||
commit-msg = let name = "git-commit-msg-hook"; in
|
||||
"${pkgs.writeShellApplication {
|
||||
inherit name;
|
||||
runtimeInputs = with pkgs; [ git ];
|
||||
text = builtins.readFile ./commit-msg.sh;
|
||||
}}/bin/${name}";
|
||||
};
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user