Commit c0e8da6

HPCesia <me@hpcesia.com>
2026-06-21 10:19:47
Add develop util aspects
1 parent ff5e38a
Changed files (9)
modules/develop/zellij/layouts/dev.kdl
@@ -0,0 +1,27 @@
+layout {
+    pane_template name="help_bar" {
+        borderless true
+        plugin location="zellij:status-bar"
+    }
+    pane_template name="tab_bar" {
+        borderless true
+        plugin location="zellij:tab-bar"
+    }
+    pane_template name="editor" { command "$EDITOR"; }
+
+    default_tab_template {
+        tab_bar size=1
+        children
+        help_bar size=1
+    }
+
+    tab name="edit" {
+        editor
+    }
+    tab name="shell" {
+        pane
+    }
+    tab name="agent" {
+        pane
+    }
+}
modules/develop/zellij/default.nix
@@ -0,0 +1,35 @@
+{
+  den.aspects.develop.zellij = {
+    homeManager = {
+      programs.zellij = {
+        enable = true;
+        settings = {
+          show_startup_tips = false;
+          show_release_notes = false;
+          pane_frames = false;
+        };
+        extraConfig = builtins.readFile ./keybinds.kdl;
+      };
+
+      xdg.configFile."zellij/layouts" = {
+        source = ./layouts;
+        recursive = true;
+      };
+
+      home.shellAliases = {
+        "zj" = "zellij";
+        "zjd" = "zellij --layout dev";
+      };
+    };
+  };
+
+  den.aspects.develop.zellij.themes = {
+    catppuccin = {
+      homeManager = {
+        programs.zellij = {
+          settings.theme = "catppuccin-mocha";
+        };
+      };
+    };
+  };
+}
modules/develop/zellij/keybinds.kdl
@@ -0,0 +1,43 @@
+keybinds {
+    shared {
+        // Previously: Ctrl + o (in helix: jump_backward)
+        bind "Ctrl e" { SwitchToMode "Session"; }
+        unbind "Ctrl o"
+        // Previously: Ctrl + s (in helix: save_selection)
+        bind "Ctrl y" { SwitchToMode "Scroll"; }
+        unbind "Ctrl s"
+        // Previously: Alt + i (in helix: shrink_selection)
+        bind "Alt w" { MoveTab "Left"; }
+        unbind "Alt i"
+        // Previously: Alt + o (in helix: expand_selection)
+        bind "Alt q" { MoveTab "Right"; }
+        unbind "Alt o"
+        // Previously: Alt + n (in helix: select_next_sibling)
+        bind "Alt m" { NewPane; }
+        unbind "Alt n"
+        // Previously: Ctrl + b (in helix: move_page_up)
+        bind "Alt 1" { SwitchToMode "Tmux"; }
+        unbind "Ctrl b"
+
+        bind "Alt f" {
+            ToggleFocusFullscreen
+            SwitchToMode "Normal"
+        }
+    }
+    session {
+        // Exit session mode
+        bind "Ctrl e" { SwitchToMode "Normal"; }
+        unbind "Ctrl o"
+    }
+    scroll {
+        // Exit scroll mode
+        bind "Ctrl y" { SwitchToMode "Normal"; }
+        unbind "Ctrl s"
+    }
+    tmux {
+        // Exit tmux mode
+        bind "Alt 1" { SwitchToMode "Normal"; }
+        unbind "Ctrl b"
+    }
+}
+
modules/develop/utils.nix
@@ -0,0 +1,30 @@
+{
+  den.aspects.develop.utils = {
+    homeManager = {pkgs, ...}: {
+      home.packages = with pkgs; [
+        # Nix
+        nixd # Nix LSP
+        alejandra # Nix formatter
+
+        # Make-like
+        gnumake
+        just
+        just-lsp
+
+        # Config file
+        vscode-json-languageserver
+        yaml-language-server
+        taplo # TOML LSP / formatter
+
+        # Script related
+        bash-language-server
+        shellcheck
+        shfmt
+
+        python3
+        ty # Python LSP
+        ruff # Python fomatter
+      ];
+    };
+  };
+}
modules/develop/wakatime.nix
@@ -0,0 +1,21 @@
+{
+  den.aspects.develop.wakatime = {
+    persistHome = {config, ...}: {
+      directories = [
+        "${config.xdg.configHome}/wakatime"
+      ];
+    };
+
+    homeManager = {
+      pkgs,
+      config,
+      ...
+    }: {
+      home.packages = [pkgs.wakatime-cli];
+
+      home.sessionVariables = {
+        WAKATIME_HOME = "${config.xdg.configHome}/wakatime";
+      };
+    };
+  };
+}
modules/develop/yazi.nix
@@ -0,0 +1,75 @@
+{
+  den.aspects.develop.yazi = {
+    homeManager = {pkgs, ...}: let
+      auto-layout = pkgs.yaziPlugins.mkYaziPlugin {
+        pname = "auto-layout.yazi";
+        version = "unstable-25-07-30";
+        src = pkgs.fetchFromGitHub {
+          owner = "luccahuguet";
+          repo = "auto-layout.yazi";
+          rev = "e24bee9f6dd15ff80eae1b3dc1a6b06ee7e66121";
+          hash = "sha256-4vRIGU/ArXhW9ervhyNhpfDN7UF4pqVYnxi6FExlgGk=";
+        };
+        meta = {
+          description = "Automatically change the column layout in yazi based on available window width";
+          homepage = "https://github.com/luccahuguet/auto-layout.yazi";
+          license = pkgs.lib.licenses.mit;
+        };
+      };
+    in {
+      programs.yazi = {
+        enable = true;
+        enableBashIntegration = true;
+        enableFishIntegration = true;
+        shellWrapperName = "yy";
+        plugins = {
+          git = pkgs.yaziPlugins.git;
+          auto-layout = auto-layout;
+        };
+        initLua = ''
+          require("git"):setup()
+          require("auto-layout").setup()
+        '';
+        settings = {
+          mgr = {
+            show_hidden = true;
+            sort_dir_first = true;
+          };
+          plugin.prepend_fetchers = [
+            {
+              url = "*";
+              run = "git";
+              group = "git";
+            }
+            {
+              url = "*/";
+              run = "git";
+              group = "git";
+            }
+          ];
+        };
+      };
+    };
+  };
+
+  den.aspects.develop.yazi.themes = {
+    catppuccin = {
+      homeManager = {pkgs, ...}: let
+        catppuccin-yazi = pkgs.fetchurl {
+          url = "https://github.com/catppuccin/yazi/raw/baaf5d1c9427b836fbefd126aa855f9eab7a9d0d/themes/mocha/catppuccin-mocha-mauve.toml";
+          hash = "sha256-MaVO1ZSjxqULH00NoY9J6hEOw9QQA2vV6saN17WF9yE=";
+        };
+        catppuccin-syntax = pkgs.fetchurl {
+          name = "Catppuccin-Mocha.tmTheme";
+          url = "https://github.com/catppuccin/bat/raw/6810349b28055dce54076712fc05fc68da4b8ec0/themes/Catppuccin%20Mocha.tmTheme";
+          hash = "sha256-OVVm8IzrMBuTa5HAd2kO+U9662UbEhVT8gHJnCvUqnc=";
+        };
+      in {
+        xdg.configFile = {
+          "yazi/theme.toml".source = catppuccin-yazi;
+          "yazi/Catppuccin-mocha.tmTheme".source = catppuccin-syntax;
+        };
+      };
+    };
+  };
+}
modules/develop/zoxide.nix
@@ -0,0 +1,17 @@
+{
+  den.aspects.develop.zoxide = {
+    cacheHome = {config, ...}: {
+      directories = [
+        "${config.xdg.dataHome}/zoxide" # Zoxide database
+      ];
+    };
+
+    homeManager = {
+      programs.zoxide = {
+        enable = true;
+        enableBashIntegration = true;
+        enableFishIntegration = true;
+      };
+    };
+  };
+}
modules/roles/develop.nix
@@ -4,6 +4,7 @@
       develop.binfmt
       develop.direnv
       develop.git
+      develop.utils
       develop.xdg
 
       services.podman
modules/users/hpcesia/default.nix
@@ -13,6 +13,10 @@
           develop.editor.helix
           develop.editor.helix.lang.nix
           develop.jujutsu
+          develop.wakatime
+          develop.yazi
+          develop.zellij
+          develop.zoxide
         ]))
       ++ (den.lib.policy.when
         ({host, ...}: host.hasAspect den.aspects.roles.desktop)