From 356daee7d186ed0fdcbb1d845e1c78af885af4e8 Mon Sep 17 00:00:00 2001 From: gwg313 Date: Thu, 16 Apr 2026 23:07:23 -0400 Subject: [PATCH] switch tmux -> zellij --- flake.lock | 109 +++++++++++++++- flake.nix | 3 + modules/features/programs/cli/cli-zellij.nix | 123 +++++++++++++++++++ modules/features/shell.nix | 2 +- 4 files changed, 235 insertions(+), 2 deletions(-) create mode 100644 modules/features/programs/cli/cli-zellij.nix diff --git a/flake.lock b/flake.lock index 88f5c12..894b0f9 100644 --- a/flake.lock +++ b/flake.lock @@ -68,6 +68,21 @@ "type": "github" } }, + "crane": { + "locked": { + "lastModified": 1775790182, + "narHash": "sha256-pG2RWVQY0Pe+rmmXJx+Jpyi+JcgjWzS18m7fcD1B64Q=", + "owner": "ipetkov", + "repo": "crane", + "rev": "534982f1c41834b101e381b07b1121a4f065a374", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, "firefox-gnome-theme": { "flake": false, "locked": { @@ -160,6 +175,24 @@ "type": "github" } }, + "flake-utils": { + "inputs": { + "systems": "systems_4" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "fromYaml": { "flake": false, "locked": { @@ -408,6 +441,22 @@ "type": "github" } }, + "nixpkgs_3": { + "locked": { + "lastModified": 1775763530, + "narHash": "sha256-BuTK9z1QEwWPOIakQ1gCN4pa4VwVJpfptYCviy2uOGc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b0188973b4b2a5b6bdba8b65381d6cd09a533da0", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "noctalia": { "inputs": { "nixpkgs": [ @@ -515,7 +564,29 @@ "secrets": "secrets", "sops-nix": "sops-nix", "stylix": "stylix", - "wrapper-modules": "wrapper-modules" + "wrapper-modules": "wrapper-modules", + "zjstatus": "zjstatus" + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "zjstatus", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1775790837, + "narHash": "sha256-RAHjn8sjgfF3D17BaV8iv69o3P+L9aCuE36PFwzoqHU=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "c913e0b9525311f103b7e1463ebb0f28c6865d8d", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" } }, "secrets": { @@ -632,6 +703,21 @@ "type": "github" } }, + "systems_4": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "tinted-foot": { "flake": false, "locked": { @@ -785,6 +871,27 @@ "repo": "xwayland-satellite", "type": "github" } + }, + "zjstatus": { + "inputs": { + "crane": "crane", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs_3", + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1775885119, + "narHash": "sha256-YNcOUBFt3dYFbhpgIGEPTdBi5vH3LbEGfRoTUokfmyw=", + "owner": "dj95", + "repo": "zjstatus", + "rev": "4ef69ff55930373d60f6c85afc39b2494850feeb", + "type": "github" + }, + "original": { + "owner": "dj95", + "repo": "zjstatus", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 92bc71b..96c3c79 100644 --- a/flake.nix +++ b/flake.nix @@ -30,6 +30,9 @@ url = "github:nix-community/nix-index-database"; inputs.nixpkgs.follows = "nixpkgs"; }; + zjstatus = { + url = "github:dj95/zjstatus"; + }; secrets.url = "git+ssh://git@github.com/gwg313/nixos-secrets.git"; }; diff --git a/modules/features/programs/cli/cli-zellij.nix b/modules/features/programs/cli/cli-zellij.nix new file mode 100644 index 0000000..cb36a59 --- /dev/null +++ b/modules/features/programs/cli/cli-zellij.nix @@ -0,0 +1,123 @@ +{ inputs, ... }: +{ + config.dendritic.features.cli-zellij = { + homeModules = [ + ( + { + config, + pkgs, + ... + }: + let + zjstatus-pkg = inputs.zjstatus.packages.${pkgs.system}.default; + in + { + stylix.targets.zellij.enable = false; + stylix.targets.tmux.enable = false; + + programs.zellij = { + enable = true; + settings = { + show_startup_tips = false; + pane_frames = false; + default_mode = "locked"; + mouse_mode = true; + simplified_ui = true; + on_force_close = "detach"; + copy_command = "wl-copy"; + default_shell = "zsh"; + + theme = "dendritic"; + themes.dendritic = { + fg = "#${config.lib.stylix.colors.base05}"; + bg = "#${config.lib.stylix.colors.base00}"; + black = "#${config.lib.stylix.colors.base01}"; + red = "#${config.lib.stylix.colors.base08}"; + green = "#${config.lib.stylix.colors.base0B}"; + yellow = "#${config.lib.stylix.colors.base0A}"; + blue = "#${config.lib.stylix.colors.base0D}"; + magenta = "#${config.lib.stylix.colors.base0E}"; + cyan = "#${config.lib.stylix.colors.base0C}"; + white = "#${config.lib.stylix.colors.base07}"; + orange = "#${config.lib.stylix.colors.base09}"; + }; + }; + + extraConfig = '' + layout { + default_tab_template { + pane size=2 borderless=true { + plugin location="file://${zjstatus-pkg}/bin/zjstatus.wasm" { + format_left "{mode}#[bg=#${config.lib.stylix.colors.base00}] {tabs}" + format_center "" + format_right "#[bg=#${config.lib.stylix.colors.base00},fg=#${config.lib.stylix.colors.base0D}]#[bg=#${config.lib.stylix.colors.base0D},fg=#${config.lib.stylix.colors.base00},bold] #[bg=#${config.lib.stylix.colors.base02},fg=#${config.lib.stylix.colors.base05},bold] {session} " + format_space "" + + mode_locked "#[bg=#${config.lib.stylix.colors.base08},fg=#${config.lib.stylix.colors.base00},bold] 🔒 LOCKED #[bg=#${config.lib.stylix.colors.base03},fg=#${config.lib.stylix.colors.base08}]█" + mode_normal "#[bg=#${config.lib.stylix.colors.base0B},fg=#${config.lib.stylix.colors.base00},bold] 🔓 NORMAL #[bg=#${config.lib.stylix.colors.base03},fg=#${config.lib.stylix.colors.base0B}]█" + mode_scroll "#[bg=#${config.lib.stylix.colors.base0A},fg=#${config.lib.stylix.colors.base00},bold] SCROLL #[bg=#${config.lib.stylix.colors.base03},fg=#${config.lib.stylix.colors.base0A}]█" + + tab_normal "#[bg=#${config.lib.stylix.colors.base03},fg=#${config.lib.stylix.colors.base0D}]█#[bg=#${config.lib.stylix.colors.base0D},fg=#${config.lib.stylix.colors.base00},bold]{index} #[bg=#${config.lib.stylix.colors.base02},fg=#${config.lib.stylix.colors.base05},bold] {name}#[bg=#${config.lib.stylix.colors.base03},fg=#${config.lib.stylix.colors.base02},bold]█" + tab_active "#[bg=#${config.lib.stylix.colors.base03},fg=#${config.lib.stylix.colors.base09}]█#[bg=#${config.lib.stylix.colors.base09},fg=#${config.lib.stylix.colors.base00},bold]{index} #[bg=#${config.lib.stylix.colors.base02},fg=#${config.lib.stylix.colors.base05},bold] {name}#[bg=#${config.lib.stylix.colors.base03},fg=#${config.lib.stylix.colors.base02},bold]█" + tab_separator "#[bg=#${config.lib.stylix.colors.base00}] " + } + } + children + } + } + + keybinds clear-defaults=true { + shared { + bind "Alt h" { MoveFocus "Left"; } + bind "Alt j" { MoveFocus "Down"; } + bind "Alt k" { MoveFocus "Up"; } + bind "Alt l" { MoveFocus "Right"; } + bind "Alt f" { ToggleFloatingPanes; } + bind "Alt n" { NewPane; } + } + + locked { + bind "Ctrl b" { SwitchToMode "Normal"; } + } + + normal { + bind "Ctrl b" { SwitchToMode "Locked"; } + bind "Enter" "Esc" { SwitchToMode "Locked"; } + + bind "h" { MoveFocus "Left"; } + bind "j" { MoveFocus "Down"; } + bind "k" { MoveFocus "Up"; } + bind "l" { MoveFocus "Right"; } + bind "|" { NewPane "Right"; } + bind "-" { NewPane "Down"; } + bind "x" { CloseFocus; } + bind "f" { ToggleFloatingPanes; } + bind "z" { ToggleFocusFullscreen; } + bind "t" { NewTab; } + bind "r" { SwitchToMode "RenameTab"; TabNameInput 0; } + + bind "s" { SwitchToMode "Scroll"; } + bind "d" { Detach; } + bind "q" { Quit; } + } + + scroll { + bind "s" "Esc" "Enter" { SwitchToMode "Normal"; } + bind "j" { ScrollDown; } + bind "k" { ScrollUp; } + bind "d" { HalfPageScrollDown; } + bind "u" { HalfPageScrollUp; } + } + + renametab { + bind "Enter" "Esc" { SwitchToMode "Normal"; } + } + } + ''; + }; + + } + ) + ]; + }; +} diff --git a/modules/features/shell.nix b/modules/features/shell.nix index bb4d629..45c697d 100644 --- a/modules/features/shell.nix +++ b/modules/features/shell.nix @@ -6,7 +6,7 @@ "cli-zoxide" "git-lazygit" "cli-zsh" - "cli-tmux" + "cli-zellij" ]; homeModules = [