about summary refs log tree commit diff stats
path: root/hm/soispha/conf/git/default.nix
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-12-29 08:52:27 +0100
committerSoispha <soispha@vhack.eu>2023-12-29 08:52:27 +0100
commitd3ed407d335d3faed952ab3fb1232550c9bca4fd (patch)
treeb12a8381fe2097b795f380b0b336a0236f311736 /hm/soispha/conf/git/default.nix
parentfix(hm/conf/git): Revert changing the st alias to the short status (diff)
downloadnixos-config-d3ed407d335d3faed952ab3fb1232550c9bca4fd.zip
feat(hm/conf/git): Use the previous commit's scope when committing
Diffstat (limited to 'hm/soispha/conf/git/default.nix')
-rw-r--r--hm/soispha/conf/git/default.nix12
1 files changed, 11 insertions, 1 deletions
diff --git a/hm/soispha/conf/git/default.nix b/hm/soispha/conf/git/default.nix
index 46f272eb..eda42210 100644
--- a/hm/soispha/conf/git/default.nix
+++ b/hm/soispha/conf/git/default.nix
@@ -2,16 +2,26 @@
   nixosConfig,
   lib,
   config,
+  sysLib,
+  pkgs,
   ...
 }: let
   gitIgnoreFile = ./git_ignore.git;
   gitTemplateFile = ./git_template.git;
+  commit = sysLib.writeShellScriptWithLibraryAndKeepPath {
+    name = "commit";
+    src = ./scripts/commit;
+    dependencies = with pkgs; [
+      git
+      gnused
+    ];
+  };
 in {
   programs.git = {
     enable = true;
     #package = pkgs.gitAndTools.gitFull; # TODO: for git send-email support
     aliases = {
-      cm = "commit --verbose";
+      cm = "!${commit}/bin/commit";
       cmr = "commit --file .git/COMMIT_EDITMSG --edit --verbose";
 
       st = "status";