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
This commit was merged in pull request #5.
This commit is contained in:
@@ -23,6 +23,7 @@
|
|||||||
kubectl.enable = true;
|
kubectl.enable = true;
|
||||||
tmux.enable = true;
|
tmux.enable = true;
|
||||||
plasma-manager.enable = true;
|
plasma-manager.enable = true;
|
||||||
|
starship.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
targets.genericLinux.enable = true;
|
targets.genericLinux.enable = true;
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
plasma-manager.enable = true;
|
plasma-manager.enable = true;
|
||||||
emacs.enable = true;
|
emacs.enable = true;
|
||||||
i3_sway.enable = true;
|
i3_sway.enable = true;
|
||||||
|
starship.enable = true;
|
||||||
|
|
||||||
# Launcher wrappers for excluded/optional packages
|
# Launcher wrappers for excluded/optional packages
|
||||||
launchers = {
|
launchers = {
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
plasma-manager.enable = true;
|
plasma-manager.enable = true;
|
||||||
emacs.enable = true;
|
emacs.enable = true;
|
||||||
i3_sway.enable = true;
|
i3_sway.enable = true;
|
||||||
|
starship.enable = true;
|
||||||
# development.enable = false; # Not needed for live USB
|
# development.enable = false; # Not needed for live USB
|
||||||
# communication.enable = false; # Not needed for live USB
|
# communication.enable = false; # Not needed for live USB
|
||||||
# office.enable = false; # Not needed for live USB
|
# office.enable = false; # Not needed for live USB
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
plasma-manager.enable = true;
|
plasma-manager.enable = true;
|
||||||
emacs.enable = true;
|
emacs.enable = true;
|
||||||
i3_sway.enable = true;
|
i3_sway.enable = true;
|
||||||
|
starship.enable = true;
|
||||||
# office.enable = false; # Not needed for media center
|
# office.enable = false; # Not needed for media center
|
||||||
# sync.enable = false; # Shared machine, no personal file sync
|
# sync.enable = false; # Shared machine, no personal file sync
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -19,5 +19,6 @@
|
|||||||
./sync
|
./sync
|
||||||
./tmux
|
./tmux
|
||||||
./emacs
|
./emacs
|
||||||
|
./starship
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
72
home/roles/starship/default.nix
Normal file
72
home/roles/starship/default.nix
Normal file
@@ -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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user