Files
nixos/Droidnix/generated/system/applications/terminal_shell/starship.nix
T
2026-03-07 23:18:19 +01:00

52 lines
1.3 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
config,
pkgs,
lib,
user,
...
}:
{
# NixOS: Install Starship system-wide (optional)
environment.systemPackages = with pkgs; [ starship ];
# Home Manager: Configure Starship for the user
home-manager.users.${user.username} = {
programs.starship = {
enable = true; # Enables Starship and adds init to shell configs
# Simple settings (flat Nix attributes)
settings = {
add_newline = false;
};
};
# Provide a full starship.toml via xdg.configFile
xdg.configFile."starship.toml".text = ''
format = "$all"
[character]
success_symbol = "[](bold green)"
error_symbol = "[](bold red)"
vicmd_symbol = "[](bold blue)"
[directory]
truncation_length = 3
style = "bold blue"
[git_branch]
symbol = " "
style = "bold purple"
format = "[$symbol$branch]($style) "
'';
# Optional: Manually ensure Starship init is in shell configs
xdg.configFile."bashrc".text = lib.concatStringsSep "\n" [
"${config.programs.starship.extraInit}"
"eval \"$(starship init bash)\""
];
xdg.configFile."zshrc".text = lib.concatStringsSep "\n" [
"${config.programs.starship.extraInit}"
"eval \"$(starship init zsh)\""
];
};
}