about summary refs log tree commit diff stats
path: root/modules/by-name/gi
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--modules/by-name/gi/git/aliases.nix24
-rw-r--r--modules/by-name/gi/git/git_ignore.git.license9
-rw-r--r--modules/by-name/gi/git/git_template.git.license9
-rw-r--r--modules/by-name/gi/git/module.nix55
4 files changed, 65 insertions, 32 deletions
diff --git a/modules/by-name/gi/git/aliases.nix b/modules/by-name/gi/git/aliases.nix
index 96456bea..948ec131 100644
--- a/modules/by-name/gi/git/aliases.nix
+++ b/modules/by-name/gi/git/aliases.nix
@@ -1,3 +1,12 @@
+# nixos-config - My current NixOS configuration
+#
+# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+# This file is part of my nixos-config.
+#
+# You should have received a copy of the License along with this program.
+# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
 {
   lib,
   defaultBranchName,
@@ -20,20 +29,11 @@
   lg2 = "lg2-specific --all";
   lg3 = "lg3-specific --all";
 
-  lg1-specific = "log --graph --abbrev-commit --decorate \
-                      --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold cyan) [%G?]%C(reset)%C(auto)%d%C(reset)'";
+  lg1-specific = "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold cyan) [%G?]%C(reset)%C(auto)%d%C(reset)'";
 
-  lg2-specific = "log --graph --abbrev-commit --decorate \
-                      --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(auto)%d%C(reset)%n''          %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'";
+  lg2-specific = "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(auto)%d%C(reset)%n''          %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'";
 
-  lg3-specific = "log --graph --abbrev-commit --decorate \
-                      --format=format:'%C(bold blue)%h%C(reset)\
-                      - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)\
-                      %C(bold cyan)(committed: %cD)%C(reset) %C(auto)%d%C(reset)\
-                      %C(bold red)(signature: %G? by %GS, trust: %GT)%C(reset)%n\
-                      ''          %C(white)%s%C(reset)%n''\
-                      %C(dim white)- %an <%ae> %C(reset) %C(dim white)(committer: %cn <%ce>)%C(reset)\
-                      %C(bold white)- trailers: %(trailers) %C(reset)'";
+  lg3-specific = "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset) %C(bold cyan)(committed: %cD)%C(reset) %C(auto)%d%C(reset) %C(bold red)(signature: %G? by %GS, trust: %GT)%C(reset)%n ''          %C(white)%s%C(reset)%n'' %C(dim white)- %an <%ae> %C(reset) %C(dim white)(committer: %cn <%ce>)%C(reset) %C(bold white)- trailers: %(trailers) %C(reset)'";
 
   # hard reset with commit before (use reflog to recover)
   #    git wipe [<commit>]
diff --git a/modules/by-name/gi/git/git_ignore.git.license b/modules/by-name/gi/git/git_ignore.git.license
new file mode 100644
index 00000000..eae6a84c
--- /dev/null
+++ b/modules/by-name/gi/git/git_ignore.git.license
@@ -0,0 +1,9 @@
+nixos-config - My current NixOS configuration
+
+Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+SPDX-License-Identifier: GPL-3.0-or-later
+
+This file is part of my nixos-config.
+
+You should have received a copy of the License along with this program.
+If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
diff --git a/modules/by-name/gi/git/git_template.git.license b/modules/by-name/gi/git/git_template.git.license
new file mode 100644
index 00000000..eae6a84c
--- /dev/null
+++ b/modules/by-name/gi/git/git_template.git.license
@@ -0,0 +1,9 @@
+nixos-config - My current NixOS configuration
+
+Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+SPDX-License-Identifier: GPL-3.0-or-later
+
+This file is part of my nixos-config.
+
+You should have received a copy of the License along with this program.
+If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
diff --git a/modules/by-name/gi/git/module.nix b/modules/by-name/gi/git/module.nix
index 8e413e8a..64a64904 100644
--- a/modules/by-name/gi/git/module.nix
+++ b/modules/by-name/gi/git/module.nix
@@ -1,3 +1,12 @@
+# nixos-config - My current NixOS configuration
+#
+# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+# This file is part of my nixos-config.
+#
+# You should have received a copy of the License along with this program.
+# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
 {
   lib,
   config,
@@ -12,21 +21,39 @@ in {
     enable = lib.mkEnableOption "an opinionated git config";
     defaultBranchName = lib.mkOption {
       type = lib.types.str;
-      description = "The Name of the default branch.";
+      description = "The name of the default branch.";
       default = "prime";
     };
   };
 
   config = lib.mkIf cfg.enable {
     home-manager.users.soispha = {
-      programs.git = {
+      programs.delta = {
         enable = true;
-        #package = pkgs.gitAndTools.gitFull; # TODO: for git send-email support
-        aliases = import ./aliases.nix {
-          inherit lib;
-          inherit (cfg) defaultBranchName;
+        enableGitIntegration = true;
+        options = {
+          decorations = {
+            commit-decoration-style = "bold yellow box ul";
+            file-decoration-style = "none";
+            file-style = "bold yellow ul";
+          };
+          keep-plus-minus-markers = true;
+          features = "decorations";
+          whitespace-error-style = "22 reverse";
         };
-        extraConfig = {
+      };
+
+      programs.git = {
+        enable = true;
+
+        signing.format = "openpgp";
+
+        settings = {
+          alias = import ./aliases.nix {
+            inherit lib;
+            inherit (cfg) defaultBranchName;
+          };
+
           core = {
             excludesFile = "${gitIgnoreFile}";
           };
@@ -91,19 +118,7 @@ in {
             };
           };
         };
-        delta = {
-          enable = true;
-          options = {
-            decorations = {
-              commit-decoration-style = "bold yellow box ul";
-              file-decoration-style = "none";
-              file-style = "bold yellow ul";
-            };
-            keep-plus-minus-markers = true;
-            features = "decorations";
-            whitespace-error-style = "22 reverse";
-          };
-        };
+
         signing = {
           key = "8321ED3A8DB999A51F3BF80FF2682914EA42DE26";
           signByDefault = true;