From cc2e26025449b5c4695a166894b99e3a8dcc0ce8 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com>
Date: Mon, 12 May 2025 09:44:00 +0000
Subject: [PATCH 1/4] automated: Update `flake.lock`
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

- The following Nix Flake inputs were updated:

```
• Updated input 'home-manager':
    'github:nix-community/home-manager/9676e8a52a177d80c8a42f66566362a6d74ecf78?narHash=sha256-bvcatss0xodcdxXm0LUSLPd2jjrhqO3yFSu3stOfQXg%3D' (2025-04-19)
  → 'github:nix-community/home-manager/fb061f555f821fe4fb49f8f6f2a0cc3d5728bd52?narHash=sha256-IDsM/9/tHQBlhG3tXI2fTM84AUN1uRa7JDPT1LMlGes%3D' (2025-05-12)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/b024ced1aac25639f8ca8fdfc2f8c4fbd66c48ef?narHash=sha256-fusHbZCyv126cyArUwwKrLdCkgVAIaa/fQJYFlCEqiU%3D' (2025-04-17)
  → 'github:NixOS/nixpkgs/d89fc19e405cb2d55ce7cc114356846a0ee5e956?narHash=sha256-3e%2BAVBczosP5dCLQmMoMEogM57gmZ2qrVSrmq9aResQ%3D' (2025-05-10)
```

Auto-generated by [update.yml][1] with the help of
[create-pull-request][2].

[1]: https://forgejo.stefka.eu/jiriks74/nix.nvim/src/branch/main/.github/workflows/update.yml
[2]: https://forgejo.stefka.eu/jiriks74/create-pull-request
---
 flake.lock | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/flake.lock b/flake.lock
index d0ffe15..3f3347e 100644
--- a/flake.lock
+++ b/flake.lock
@@ -7,11 +7,11 @@
         ]
       },
       "locked": {
-        "lastModified": 1745071558,
-        "narHash": "sha256-bvcatss0xodcdxXm0LUSLPd2jjrhqO3yFSu3stOfQXg=",
+        "lastModified": 1747021744,
+        "narHash": "sha256-IDsM/9/tHQBlhG3tXI2fTM84AUN1uRa7JDPT1LMlGes=",
         "owner": "nix-community",
         "repo": "home-manager",
-        "rev": "9676e8a52a177d80c8a42f66566362a6d74ecf78",
+        "rev": "fb061f555f821fe4fb49f8f6f2a0cc3d5728bd52",
         "type": "github"
       },
       "original": {
@@ -22,11 +22,11 @@
     },
     "nixpkgs": {
       "locked": {
-        "lastModified": 1744932701,
-        "narHash": "sha256-fusHbZCyv126cyArUwwKrLdCkgVAIaa/fQJYFlCEqiU=",
+        "lastModified": 1746904237,
+        "narHash": "sha256-3e+AVBczosP5dCLQmMoMEogM57gmZ2qrVSrmq9aResQ=",
         "owner": "NixOS",
         "repo": "nixpkgs",
-        "rev": "b024ced1aac25639f8ca8fdfc2f8c4fbd66c48ef",
+        "rev": "d89fc19e405cb2d55ce7cc114356846a0ee5e956",
         "type": "github"
       },
       "original": {

From 8c163b6814c38d68f376f3d5cc4e660087054f7e Mon Sep 17 00:00:00 2001
From: jiriks74 <jiri@stefka.eu>
Date: Thu, 19 Jun 2025 17:23:37 +0200
Subject: [PATCH 2/4] fix(modules/default.nix): Migrate from `initExtra` and
 `initExtraFirst` to `initContent`

---
 modules/default.nix | 136 ++++++++++++++++++++++----------------------
 1 file changed, 69 insertions(+), 67 deletions(-)

diff --git a/modules/default.nix b/modules/default.nix
index db5c722..a007c8a 100644
--- a/modules/default.nix
+++ b/modules/default.nix
@@ -83,82 +83,84 @@ in {
           ];
         };
 
-        initExtraFirst = ''
-          # Basic auto/tab complete:
-          autoload -U compinit
-          zstyle ':completion:*' menu select
-          zmodload zsh/complist
-          _comp_options+=(globdots)               # Include hidden files.
+        initContent = let
+          initExtraFirst = lib.mkBefore ''
+            # Basic auto/tab complete:
+            autoload -U compinit
+            zstyle ':completion:*' menu select
+            zmodload zsh/complist
+            _comp_options+=(globdots)               # Include hidden files.
 
-          if [[ "''${ZSH_PROFILE}" -eq 1 ]]; then
-            zmodload zsh/zprof # Profiling. Enable `zprof` at the end of initExtra too.
-          fi
-        '';
+            if [[ "''${ZSH_PROFILE}" -eq 1 ]]; then
+              zmodload zsh/zprof # Profiling. Enable `zprof` at the end of initExtra too.
+            fi
+          '';
 
-        initExtra = ''
-          # From antidote (for p10k):
-          # prompts:
-          #   with prompt plugins, remember to add this to your .zshrc:
-          # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
-          [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
-          autoload -Uz promptinit && promptinit && prompt powerlevel10k
+          initExtra = ''
+            # From antidote (for p10k):
+            # prompts:
+            #   with prompt plugins, remember to add this to your .zshrc:
+            # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
+            [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
+            autoload -Uz promptinit && promptinit && prompt powerlevel10k
 
-          # Remove nix from path if we are in a container (distrobox)
-          if [ -v DISTROBOX_ENTER_PATH ]; then
-            export PATH=$(echo $PATH | tr ':' '\n' | grep -vE '/nix/|/run/wrappers|\.nix-profile|/etc/profiles/per-user/jirka/bin|/run/current-system/sw/bin' | tr '\n' ':')
-            export PATH=$(echo $PATH | sed 's/:$//')
-          fi
+            # Remove nix from path if we are in a container (distrobox)
+            if [ -v DISTROBOX_ENTER_PATH ]; then
+              export PATH=$(echo $PATH | tr ':' '\n' | grep -vE '/nix/|/run/wrappers|\.nix-profile|/etc/profiles/per-user/jirka/bin|/run/current-system/sw/bin' | tr '\n' ':')
+              export PATH=$(echo $PATH | sed 's/:$//')
+            fi
 
-          if [ -v ASCIINEMA_REC ]; then
-            _zsh_autosuggest_disable
-          fi
+            if [ -v ASCIINEMA_REC ]; then
+              _zsh_autosuggest_disable
+            fi
 
-          bindkey '^ ' autosuggest-accept # Bind CTRL + Space
-          bindkey '^Y' autosuggest-accept # Bind CTRL + Y
+            bindkey '^ ' autosuggest-accept # Bind CTRL + Space
+            bindkey '^Y' autosuggest-accept # Bind CTRL + Y
 
-          bindkey "$terminfo[kcuu1]" history-substring-search-up
-          bindkey "$terminfo[kcud1]" history-substring-search-down
-          bindkey -M vicmd 'k' history-substring-search-up
-          bindkey -M vicmd 'j' history-substring-search-down
+            bindkey "$terminfo[kcuu1]" history-substring-search-up
+            bindkey "$terminfo[kcud1]" history-substring-search-down
+            bindkey -M vicmd 'k' history-substring-search-up
+            bindkey -M vicmd 'j' history-substring-search-down
 
-          # Extracting
-          ex ()
-          {
-          if [ -f $1 ] ; then
-            case $1 in
-              *.tar.bz2)   tar xjf $1   ;;
-              *.tar.gz)    tar xzf $1   ;;
-              *.tar.xz)    tar xJf $1   ;;
-              *.bz2)       bunzip3 $1   ;;
-              *.rar)       unrar x $1   ;;
-              *.gz)        gunzip $1    ;;
-              *.tar)       tar xf $1    ;;
-              *.tbz2)      tar xjf $1   ;;
-              *.tgz)       tar xzf $1   ;;
-              *.zip)       unzip $1     ;;
-              *.Z)         uncompress $1;;
-              *.7z)        7z x $1      ;;
-              *)           echo "'$1' cannot be extracted via ex()" ;;
-            esac
-          else
-            echo "'$1' is not a valid file"
-          fi
-          }
+            # Extracting
+            ex ()
+            {
+            if [ -f $1 ] ; then
+              case $1 in
+                *.tar.bz2)   tar xjf $1   ;;
+                *.tar.gz)    tar xzf $1   ;;
+                *.tar.xz)    tar xJf $1   ;;
+                *.bz2)       bunzip3 $1   ;;
+                *.rar)       unrar x $1   ;;
+                *.gz)        gunzip $1    ;;
+                *.tar)       tar xf $1    ;;
+                *.tbz2)      tar xjf $1   ;;
+                *.tgz)       tar xzf $1   ;;
+                *.zip)       unzip $1     ;;
+                *.Z)         uncompress $1;;
+                *.7z)        7z x $1      ;;
+                *)           echo "'$1' cannot be extracted via ex()" ;;
+              esac
+            else
+              echo "'$1' is not a valid file"
+            fi
+            }
 
-          # Kitty binds
-          if [ "$TERM" = "xterm-kitty" ]; then
-            alias kssh="kitty +kitten ssh"
-            alias icat="kitty +kitten icat"
-            alias d="kitty +kitten diff"
-            alias get="kitty +kitten transfer"
-            alias put="kitty +kitten transfer --direction=upload"
-            alias kclip="kitty +kitten clipboard"
-          fi
+            # Kitty binds
+            if [ "$TERM" = "xterm-kitty" ]; then
+              alias kssh="kitty +kitten ssh"
+              alias icat="kitty +kitten icat"
+              alias d="kitty +kitten diff"
+              alias get="kitty +kitten transfer"
+              alias put="kitty +kitten transfer --direction=upload"
+              alias kclip="kitty +kitten clipboard"
+            fi
 
-          if [[ "''${ZSH_PROFILE}" -eq 1 ]]; then
-            zprof
-          fi
-        '';
+            if [[ "''${ZSH_PROFILE}" -eq 1 ]]; then
+              zprof
+            fi
+          '';
+        in lib.mkMerge [ initExtraFirst initExtra ];
 
         localVariables = {
           YSU_MESSAGE_POSITION = "after";

From ef89e9b8f6794eb32fc2da726b1b5ec3673e93b3 Mon Sep 17 00:00:00 2001
From: jiriks74 <jiri@stefka.eu>
Date: Thu, 19 Jun 2025 17:26:59 +0200
Subject: [PATCH 3/4] feat(modules/default.nix): Add `gitignore`, `git-commit`
 and `universalarchive` plugins

---
 modules/default.nix | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/modules/default.nix b/modules/default.nix
index a007c8a..a16bcff 100644
--- a/modules/default.nix
+++ b/modules/default.nix
@@ -51,13 +51,26 @@ in {
         antidote = {
           enable = true;
           plugins = [
+            #######
+            # OMZ #
+            #######
+
             "getantidote/use-omz" # Handle OMZ dependencies
             # Load lib only if things break
             # "ohmyzsh/ohmyzsh path:lib"   # Load OMZ's library
+
             "ohmyzsh/ohmyzsh path:plugins/colored-man-pages" # Load OMZ plugins
             # "ohmyzsh/ohmyzsh path:plugins/magic-enter"
             "ohmyzsh/ohmyzsh path:plugins/command-not-found" # Provide suggested packages to be installed if a command cannot be found
             "ohmyzsh/ohmyzsh path:plugins/dirhistory kind:defer" # shortcuts for navigating directory history and hierarchy
+            "ohmyzsh/ohmyzsh path:plugins/universalarchive kind:defer"
+
+            "ohmyzsh/ohmyzsh path:plugins/gitignore kind:defer"
+            "ohmyzsh/ohmyzsh path:plugins/git-commit kind:defer"
+
+            #########
+            # OMZ ^ #
+            #########
 
             "romkatv/powerlevel10k kind:fpath" #  A Zsh theme
 

From 619ac933f7c01ab31ac22de061239632f89344ef Mon Sep 17 00:00:00 2001
From: jiriks74 <jiri@stefka.eu>
Date: Thu, 19 Jun 2025 17:35:38 +0200
Subject: [PATCH 4/4] feat(modules/gitTools): Add `git-cliff`, gitui` and
 `riffdiff`, set default branch

---
 modules/gitTools.nix | 58 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/modules/gitTools.nix b/modules/gitTools.nix
index bf03841..6e58101 100644
--- a/modules/gitTools.nix
+++ b/modules/gitTools.nix
@@ -24,6 +24,64 @@ in {
     home.packages = with pkgs; [
       gh
       tea
+      riffdiff
     ];
+
+    programs = {
+      git-cliff.enable = true;
+      gitui = {
+        enable = true;
+        keyConfig = lib.mkDefault ''
+          (
+              open_help: Some(( code: F(1), modifiers: "")),
+
+              move_left: Some(( code: Char('h'), modifiers: "")),
+              move_right: Some(( code: Char('l'), modifiers: "")),
+              move_up: Some(( code: Char('k'), modifiers: "")),
+              move_down: Some(( code: Char('j'), modifiers: "")),
+              
+              popup_up: Some(( code: Char('p'), modifiers: "CONTROL")),
+              popup_down: Some(( code: Char('n'), modifiers: "CONTROL")),
+              page_up: Some(( code: Char('b'), modifiers: "CONTROL")),
+              page_down: Some(( code: Char('f'), modifiers: "CONTROL")),
+              home: Some(( code: Char('g'), modifiers: "")),
+              end: Some(( code: Char('G'), modifiers: "SHIFT")),
+              shift_up: Some(( code: Char('K'), modifiers: "SHIFT")),
+              shift_down: Some(( code: Char('J'), modifiers: "SHIFT")),
+
+              edit_file: Some(( code: Char('I'), modifiers: "SHIFT")),
+
+              status_reset_item: Some(( code: Char('U'), modifiers: "SHIFT")),
+
+              diff_reset_lines: Some(( code: Char('u'), modifiers: "")),
+              diff_stage_lines: Some(( code: Char('s'), modifiers: "")),
+
+              stashing_save: Some(( code: Char('w'), modifiers: "")),
+              stashing_toggle_index: Some(( code: Char('m'), modifiers: "")),
+
+              stash_open: Some(( code: Char('l'), modifiers: "")),
+
+              abort_merge: Some(( code: Char('M'), modifiers: "SHIFT")),
+          )
+        '';
+      };
+
+      git = {
+        enable = true;
+        extraConfig = {
+          init = {
+            defaultBranch = lib.mkDefault "main";
+          };
+          pager = {
+            diff = lib.mkDefault "riff";
+            show = lib.mkDefault "riff";
+            log = lib.mkDefault "riff";
+          };
+          interactive = {
+            diffFilter = lib.mkDefault "riff --color=on";
+          };
+        };
+      };
+    };
   };
 }