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
73 lines
1.6 KiB
Nix
73 lines
1.6 KiB
Nix
{ 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;
|
|
};
|
|
};
|
|
};
|
|
}
|