From 9a97d94ffa9d0639a51d85163ac2be73fada789d Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Thu, 26 Feb 2026 09:46:53 -0500 Subject: [PATCH] add jj-starship and fix zellij lockout --- flake.lock | 73 ++++++++++++++++--- flake.nix | 5 ++ lib/default.nix | 1 + .../nmasur/presets/programs/starship.nix | 15 +++- .../nmasur/presets/programs/zellij.nix | 4 +- 5 files changed, 86 insertions(+), 12 deletions(-) diff --git a/flake.lock b/flake.lock index 7a5b365..9479b2a 100644 --- a/flake.lock +++ b/flake.lock @@ -4,7 +4,7 @@ "inputs": { "flake-parts": "flake-parts", "nixpkgs": "nixpkgs", - "systems": "systems", + "systems": "systems_2", "treefmt-nix": "treefmt-nix" }, "locked": { @@ -135,6 +135,24 @@ } }, "flake-utils": { + "inputs": { + "systems": "systems" + }, + "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" + } + }, + "flake-utils_2": { "inputs": { "systems": [ "mac-app-util", @@ -154,9 +172,9 @@ "type": "indirect" } }, - "flake-utils_2": { + "flake-utils_3": { "inputs": { - "systems": "systems_3" + "systems": "systems_4" }, "locked": { "lastModified": 1731533236, @@ -193,13 +211,34 @@ "type": "github" } }, + "jj-starship": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1769370163, + "narHash": "sha256-YfcFlJsPCRfqhN+3JUWE77c+eHIp5RAu2rq/JhSxCec=", + "owner": "dmmulroy", + "repo": "jj-starship", + "rev": "76cf00619b0cce5bd08a1b9a49b310ed928794d5", + "type": "github" + }, + "original": { + "owner": "dmmulroy", + "repo": "jj-starship", + "type": "github" + } + }, "mac-app-util": { "inputs": { "cl-nix-lite": "cl-nix-lite", "flake-compat": "flake-compat", - "flake-utils": "flake-utils", + "flake-utils": "flake-utils_2", "nixpkgs": "nixpkgs_3", - "systems": "systems_2", + "systems": "systems_3", "treefmt-nix": "treefmt-nix_2" }, "locked": { @@ -218,7 +257,7 @@ }, "nix2vim": { "inputs": { - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils_3", "nixpkgs": [ "nixpkgs" ] @@ -426,6 +465,7 @@ "darwin": "darwin", "disko": "disko", "home-manager": "home-manager", + "jj-starship": "jj-starship", "mac-app-util": "mac-app-util", "nix2vim": "nix2vim", "nixos-generators": "nixos-generators", @@ -472,6 +512,21 @@ } }, "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_3": { "locked": { "lastModified": 1689347925, "narHash": "sha256-ozenz5bFe1UUqOn7f60HRmgc01BgTGIKZ4Xl+HbocGQ=", @@ -486,7 +541,7 @@ "type": "github" } }, - "systems_3": { + "systems_4": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -501,7 +556,7 @@ "type": "github" } }, - "systems_4": { + "systems_5": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -581,7 +636,7 @@ "rust-overlay": [ "rust-overlay" ], - "systems": "systems_4" + "systems": "systems_5" }, "locked": { "lastModified": 1742588229, diff --git a/flake.nix b/flake.nix index 3ce7bfc..1902cfc 100644 --- a/flake.nix +++ b/flake.nix @@ -75,6 +75,11 @@ inputs.rust-overlay.follows = "rust-overlay"; }; + jj-starship = { + url = "github:dmmulroy/jj-starship"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + # # Text editor # helix = { # url = "github:helix-editor/helix"; diff --git a/lib/default.nix b/lib/default.nix index 7176195..5d79fcb 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -67,6 +67,7 @@ lib inputs.nur.overlays.default inputs.nix2vim.overlay inputs.zellij-switch.overlays.default + inputs.jj-starship.overlays.default # inputs.helix.overlays.default ] ++ (importOverlays ../overlays); diff --git a/platforms/home-manager/modules/nmasur/presets/programs/starship.nix b/platforms/home-manager/modules/nmasur/presets/programs/starship.nix index 6965822..b020204 100644 --- a/platforms/home-manager/modules/nmasur/presets/programs/starship.nix +++ b/platforms/home-manager/modules/nmasur/presets/programs/starship.nix @@ -15,6 +15,8 @@ in config = lib.mkIf cfg.enable { + home.packages = [ pkgs.jj-starship ]; + programs.starship = { enable = true; enableFishIntegration = true; @@ -27,6 +29,7 @@ in "$git_branch" "$git_commit" "$git_status" + "\${custom.jj}" "$hostname" "$cmd_duration" "$character" @@ -38,23 +41,33 @@ in vicmd_symbol = "[❮](bold green)"; }; cmd_duration = { - min_time = 5000; + min_time = 5001; show_notifications = if pkgs.stdenv.isLinux then false else true; min_time_to_notify = 30000; format = "[$duration]($style) "; }; + custom = { + jj = { + when = "jj-starship detect"; + shell = [ "jj-starship" ]; + format = "$output "; + }; + }; directory = { truncate_to_repo = true; truncation_length = 100; }; git_branch = { + disabled = true; format = "[$symbol$branch]($style)"; }; git_commit = { + disabled = true; format = "( @ [$hash]($style) )"; only_detached = false; }; git_status = { + disabled = true; format = "([$all_status$ahead_behind]($style) )"; conflicted = "="; ahead = "⇡"; diff --git a/platforms/home-manager/modules/nmasur/presets/programs/zellij.nix b/platforms/home-manager/modules/nmasur/presets/programs/zellij.nix index c9b94d9..b6e2b84 100644 --- a/platforms/home-manager/modules/nmasur/presets/programs/zellij.nix +++ b/platforms/home-manager/modules/nmasur/presets/programs/zellij.nix @@ -101,7 +101,7 @@ in show_startup_tips = false; keybinds = { - locked = { + locked = lib.mkIf (pkgs.stdenv.isLinux && !config.programs.ghostty.enable) { # For servers that I SSH into, use c-a-G to unlock "bind \"Ctrl Alt G\"" = lib.mkIf (pkgs.stdenv.isLinux && !config.programs.ghostty.enable) { SwitchToMode = { @@ -109,7 +109,7 @@ in }; }; }; - normal = { + normal = lib.mkIf (pkgs.stdenv.isLinux && !config.programs.ghostty.enable) { # For servers that I SSH into, use c-a-G to lock "bind \"Ctrl Alt G\"" = lib.mkIf (pkgs.stdenv.isLinux && !config.programs.ghostty.enable) { SwitchToMode = {