1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-27 05:29:46 +01:00

starship: initialize using command in profile

Fixes #2316
This commit is contained in:
Robert Helgesson 2021-09-19 23:59:45 +02:00
parent 821299e90e
commit 58aa667e28
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -8,6 +8,8 @@ let
tomlFormat = pkgs.formats.toml { }; tomlFormat = pkgs.formats.toml { };
starshipCmd = "${config.home.profileDirectory}/bin/starship";
in { in {
meta.maintainers = [ maintainers.marsam ]; meta.maintainers = [ maintainers.marsam ];
@ -90,19 +92,19 @@ in {
programs.bash.initExtra = mkIf cfg.enableBashIntegration '' programs.bash.initExtra = mkIf cfg.enableBashIntegration ''
if [[ $TERM != "dumb" && (-z $INSIDE_EMACS || $INSIDE_EMACS == "vterm") ]]; then if [[ $TERM != "dumb" && (-z $INSIDE_EMACS || $INSIDE_EMACS == "vterm") ]]; then
eval "$(${cfg.package}/bin/starship init bash)" eval "$(${starshipCmd} init bash)"
fi fi
''; '';
programs.zsh.initExtra = mkIf cfg.enableZshIntegration '' programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
if [[ $TERM != "dumb" && (-z $INSIDE_EMACS || $INSIDE_EMACS == "vterm") ]]; then if [[ $TERM != "dumb" && (-z $INSIDE_EMACS || $INSIDE_EMACS == "vterm") ]]; then
eval "$(${cfg.package}/bin/starship init zsh)" eval "$(${starshipCmd} init zsh)"
fi fi
''; '';
programs.fish.promptInit = mkIf cfg.enableFishIntegration '' programs.fish.promptInit = mkIf cfg.enableFishIntegration ''
if test "$TERM" != "dumb" -a \( -z "$INSIDE_EMACS" -o "$INSIDE_EMACS" = "vterm" \) if test "$TERM" != "dumb" -a \( -z "$INSIDE_EMACS" -o "$INSIDE_EMACS" = "vterm" \)
eval (${cfg.package}/bin/starship init fish) eval (${starshipCmd} init fish)
end end
''; '';
}; };