From 08c7cc9e76da60d94ea58fe853b7e5d503f0c3e2 Mon Sep 17 00:00:00 2001 From: John Ogle Date: Sat, 10 Jan 2026 10:41:26 -0800 Subject: [PATCH] feat(home): Add starship cross-shell prompt role Add a new home-manager role for starship.rs, a fast and customizable cross-shell prompt written in Rust. Configuration includes: - Bash and Zsh integration enabled - Clean character symbols (> for success, x for error) - Vi mode indicator support - Smart directory truncation (4 levels, truncate to repo root) - Git branch and status display - Nix shell indicator with snowflake symbol - Command duration for long-running commands (2s+) - Disabled noisy modules (language runtimes, cloud providers) Enabled in: home-desktop, home-laptop-compact, home-live-usb, home-media-center configurations. Closes: nixos-configs-uji --- home/home-desktop.nix | 1 + home/home-laptop-compact.nix | 1 + home/home-live-usb.nix | 1 + home/home-media-center.nix | 1 + home/roles/default.nix | 1 + home/roles/starship/default.nix | 72 +++++++++++++++++++++++++++++++++ 6 files changed, 77 insertions(+) create mode 100644 home/roles/starship/default.nix diff --git a/home/home-desktop.nix b/home/home-desktop.nix index 4204d58..9a4ec8a 100644 --- a/home/home-desktop.nix +++ b/home/home-desktop.nix @@ -23,6 +23,7 @@ kubectl.enable = true; tmux.enable = true; plasma-manager.enable = true; + starship.enable = true; }; targets.genericLinux.enable = true; diff --git a/home/home-laptop-compact.nix b/home/home-laptop-compact.nix index 04e126c..04d218d 100644 --- a/home/home-laptop-compact.nix +++ b/home/home-laptop-compact.nix @@ -23,6 +23,7 @@ plasma-manager.enable = true; emacs.enable = true; i3_sway.enable = true; + starship.enable = true; # Launcher wrappers for excluded/optional packages launchers = { diff --git a/home/home-live-usb.nix b/home/home-live-usb.nix index 8c659ba..7ba362f 100644 --- a/home/home-live-usb.nix +++ b/home/home-live-usb.nix @@ -16,6 +16,7 @@ plasma-manager.enable = true; emacs.enable = true; i3_sway.enable = true; + starship.enable = true; # development.enable = false; # Not needed for live USB # communication.enable = false; # Not needed for live USB # office.enable = false; # Not needed for live USB diff --git a/home/home-media-center.nix b/home/home-media-center.nix index a6af15e..f6a45a0 100644 --- a/home/home-media-center.nix +++ b/home/home-media-center.nix @@ -20,6 +20,7 @@ plasma-manager.enable = true; emacs.enable = true; i3_sway.enable = true; + starship.enable = true; # office.enable = false; # Not needed for media center # sync.enable = false; # Shared machine, no personal file sync }; diff --git a/home/roles/default.nix b/home/roles/default.nix index 0fcfd54..7a879f1 100644 --- a/home/roles/default.nix +++ b/home/roles/default.nix @@ -19,5 +19,6 @@ ./sync ./tmux ./emacs + ./starship ]; } diff --git a/home/roles/starship/default.nix b/home/roles/starship/default.nix new file mode 100644 index 0000000..00fdca2 --- /dev/null +++ b/home/roles/starship/default.nix @@ -0,0 +1,72 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.home.roles.starship; +in +{ + options.home.roles.starship = { + enable = mkEnableOption "starship cross-shell prompt"; + }; + + config = mkIf cfg.enable { + programs.starship = { + enable = true; + enableBashIntegration = true; + enableZshIntegration = true; + + settings = { + add_newline = true; + + character = { + success_symbol = "[>](bold green)"; + error_symbol = "[x](bold red)"; + vimcmd_symbol = "[<](bold green)"; + }; + + directory = { + truncation_length = 4; + truncate_to_repo = true; + }; + + git_branch = { + symbol = ""; + format = "[$symbol$branch(:$remote_branch)]($style) "; + }; + + git_status = { + format = "([$all_status$ahead_behind]($style) )"; + }; + + nix_shell = { + symbol = ""; + format = "[$symbol$state( \\($name\\))]($style) "; + }; + + cmd_duration = { + min_time = 2000; + format = "[$duration]($style) "; + }; + + # Disable modules that are noisy or rarely needed + package.disabled = true; + nodejs.disabled = true; + python.disabled = true; + ruby.disabled = true; + java.disabled = true; + golang.disabled = true; + rust.disabled = true; + php.disabled = true; + lua.disabled = true; + perl.disabled = true; + terraform.disabled = true; + kubernetes.disabled = true; + docker_context.disabled = true; + aws.disabled = true; + gcloud.disabled = true; + azure.disabled = true; + }; + }; + }; +}