Loading nixos/modules/programs/starship.nix +21 −4 Original line number Diff line number Diff line Loading @@ -9,10 +9,27 @@ let settingsFile = settingsFormat.generate "starship.toml" cfg.settings; in { initOption = if cfg.interactiveOnly then "promptInit" else "shellInit"; in { options.programs.starship = { enable = mkEnableOption (lib.mdDoc "the Starship shell prompt"); interactiveOnly = mkOption { default = true; example = false; type = types.bool; description = lib.mdDoc '' Whether to enable starship only when the shell is interactive. Some plugins require this to be set to false to function correctly. ''; }; settings = mkOption { inherit (settingsFormat) type; default = { }; Loading @@ -25,21 +42,21 @@ in { }; config = mkIf cfg.enable { programs.bash.promptInit = '' programs.bash.${initOption} = '' if [[ $TERM != "dumb" && (-z $INSIDE_EMACS || $INSIDE_EMACS == "vterm") ]]; then export STARSHIP_CONFIG=${settingsFile} eval "$(${pkgs.starship}/bin/starship init bash)" fi ''; programs.fish.promptInit = '' programs.fish.${initOption} = '' if test "$TERM" != "dumb" -a \( -z "$INSIDE_EMACS" -o "$INSIDE_EMACS" = "vterm" \) set -x STARSHIP_CONFIG ${settingsFile} eval (${pkgs.starship}/bin/starship init fish) end ''; programs.zsh.promptInit = '' programs.zsh.${initOption} = '' if [[ $TERM != "dumb" && (-z $INSIDE_EMACS || $INSIDE_EMACS == "vterm") ]]; then export STARSHIP_CONFIG=${settingsFile} eval "$(${pkgs.starship}/bin/starship init zsh)" Loading Loading
nixos/modules/programs/starship.nix +21 −4 Original line number Diff line number Diff line Loading @@ -9,10 +9,27 @@ let settingsFile = settingsFormat.generate "starship.toml" cfg.settings; in { initOption = if cfg.interactiveOnly then "promptInit" else "shellInit"; in { options.programs.starship = { enable = mkEnableOption (lib.mdDoc "the Starship shell prompt"); interactiveOnly = mkOption { default = true; example = false; type = types.bool; description = lib.mdDoc '' Whether to enable starship only when the shell is interactive. Some plugins require this to be set to false to function correctly. ''; }; settings = mkOption { inherit (settingsFormat) type; default = { }; Loading @@ -25,21 +42,21 @@ in { }; config = mkIf cfg.enable { programs.bash.promptInit = '' programs.bash.${initOption} = '' if [[ $TERM != "dumb" && (-z $INSIDE_EMACS || $INSIDE_EMACS == "vterm") ]]; then export STARSHIP_CONFIG=${settingsFile} eval "$(${pkgs.starship}/bin/starship init bash)" fi ''; programs.fish.promptInit = '' programs.fish.${initOption} = '' if test "$TERM" != "dumb" -a \( -z "$INSIDE_EMACS" -o "$INSIDE_EMACS" = "vterm" \) set -x STARSHIP_CONFIG ${settingsFile} eval (${pkgs.starship}/bin/starship init fish) end ''; programs.zsh.promptInit = '' programs.zsh.${initOption} = '' if [[ $TERM != "dumb" && (-z $INSIDE_EMACS || $INSIDE_EMACS == "vterm") ]]; then export STARSHIP_CONFIG=${settingsFile} eval "$(${pkgs.starship}/bin/starship init zsh)" Loading