Jump to content

Starship: Difference between revisions

From NixOS Wiki
Ardenet (talk | contribs)
adjust translate tag's placement
Tags: Mobile edit Mobile web edit
Granddave (talk | contribs)
m "Home Configuration" -> "Home Manager", capitalize Starship
 
(4 intermediate revisions by 2 users not shown)
Line 2: Line 2:
<translate>
<translate>
<!--T:1-->
<!--T:1-->
[https://starship.rs/ Starship] is a fast, customizable, and minimal prompt for any shell. written in Rust, It displays relevant information like the current directory, Git status, runtime versions, and more, adapting to the context with minimal configuration. It supports multiple shells, including '''Bash''', [https://wiki.nixos.org/wiki/Zsh '''Zsh'''], [https://wiki.nixos.org/wiki/Fish '''Fish'''], '''PowerShell''' and a lot of other shells, and your configuration will stay persistent across all these shells and is designed for speed and efficiency.
[https://starship.rs/ Starship] is a fast, customizable, and minimal prompt for any shell. It is written in Rust and displays relevant information like the current directory, Git status, runtime versions, and more, adapting to the context with minimal configuration. It supports multiple shells, including [[Bash]], [https://wiki.nixos.org/wiki/Zsh Zsh], [https://wiki.nixos.org/wiki/Fish Fish], PowerShell and a lot of other shells, and your configuration will stay persistent across all these shells and is designed for speed and efficiency.


== Installation == <!--T:2-->
== Installation == <!--T:2-->
Line 24: Line 24:


<translate>
<translate>
<!--T:37-->
After modifying your configuration, apply the changes by running:
After modifying your configuration, apply the changes by running:
</translate>
</translate>
Line 32: Line 33:


<translate>
<translate>
=== Using Home Configuration === <!--T:5-->
=== Using Home Manager === <!--T:5-->
</translate>
</translate>


Line 42: Line 43:


<translate>
<translate>
<!--T:38-->
After updating your configuration, apply the changes by running:
After updating your configuration, apply the changes by running:
</translate>
</translate>
Line 61: Line 63:
<translate>
<translate>
<!--T:39-->
<!--T:39-->
after you have installed starship you need to source it in your shell
after you have installed Starship you need to source it in your shell


<!--T:45-->
Bash:
Bash:
</translate>
</translate>
Line 71: Line 74:


<translate>
<translate>
<!--T:46-->
Zsh:
Zsh:
</translate>
</translate>
Line 79: Line 83:


<translate>
<translate>
<!--T:47-->
Fish:
Fish:
</translate>
</translate>
Line 93: Line 98:


<!--T:12-->
<!--T:12-->
you can customize starship with Nix (here's a snippet to understand)
you can customize Starship with Nix (here's a snippet to understand)
<nowiki>:</nowiki>
<nowiki>:</nowiki>
</translate>
</translate>
Line 115: Line 120:
<translate>
<translate>
<!--T:13-->
<!--T:13-->
since we can't include every option on Starship here's a GitHub link <noinclude> [https://gist.github.com/s-a-c/0e44dc7766922308924812d4c019b109#file-starship-nix/ containing every configuration option] </noinclude> and here's the official documentation to explain each option [https://starship.rs/config/ starship configuration guide]
since we can't include every option on Starship here's a GitHub link <noinclude> [https://gist.github.com/s-a-c/0e44dc7766922308924812d4c019b109#file-starship-nix/ containing every configuration option] </noinclude> and here's the official documentation to explain each option [https://starship.rs/config/ Starship configuration guide]


<!--T:15-->
<!--T:15-->
good luck :D
good luck :D


<!--T:48-->
[[Category:Shell]]
[[Category:Shell]]
</translate>
</translate>

Latest revision as of 20:31, 8 October 2025

Starship is a fast, customizable, and minimal prompt for any shell. It is written in Rust and displays relevant information like the current directory, Git status, runtime versions, and more, adapting to the context with minimal configuration. It supports multiple shells, including Bash, Zsh, Fish, PowerShell and a lot of other shells, and your configuration will stay persistent across all these shells and is designed for speed and efficiency.

Installation

Using nix-shell

nix-shell -p starship

Using Global Configuration

environment.systemPackages = [
  pkgs.starship
];

After modifying your configuration, apply the changes by running:

sudo nixos-rebuild switch

Using Home Manager

home.packages = [ 
  pkgs.starship 
];

After updating your configuration, apply the changes by running:

home-manager switch

Configuration

Basic

programs.starship.enable = true;

after you have installed Starship you need to source it in your shell

Bash:

eval "$(starship init bash)"

Zsh:

eval "$(starship init zsh)"

Fish:

starship init fish | source

if you use other shells than what I just mentioned please head to this page

Advanced

you can customize Starship with Nix (here's a snippet to understand) :

programs.starship = {
  enable = true;
  settings = {
    add_newline = true;
    command_timeout = 1300;
    scan_timeout = 50;
    format = "$all$nix_shell$nodejs$lua$golang$rust$php$git_branch$git_commit$git_state$git_status\n$username$hostname$directory";
    character = {
      success_symbol = "[](bold green) ";
      error_symbol = "[✗](bold red) ";
    };
  };
};

since we can't include every option on Starship here's a GitHub link containing every configuration option and here's the official documentation to explain each option Starship configuration guide

good luck :D