From 49f92e9b2f2ee482f5a7027141568e788b342518 Mon Sep 17 00:00:00 2001 From: eljamm Date: Wed, 24 Jul 2024 18:40:22 +0100 Subject: [PATCH] starship: replace `eval` with `source` for fish Changed the initialization method from `eval` to `source` as per the starship installation guide. See: https://starship.rs/guide/#%F0%9F%9A%80-installation This is in accordance with the Fish docs which recommends using `source` if the command does not need access to stdin, which in this case is what upstream has. See: https://fishshell.com/docs/current/cmds/eval.html --- modules/programs/starship.nix | 2 +- tests/modules/programs/starship/fish_without_interactive.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/programs/starship.nix b/modules/programs/starship.nix index bbfe96989..654c43fca 100644 --- a/modules/programs/starship.nix +++ b/modules/programs/starship.nix @@ -119,7 +119,7 @@ in { programs.fish.${initFish} = mkIf cfg.enableFishIntegration '' if test "$TERM" != "dumb" - eval (${starshipCmd} init fish) + ${starshipCmd} init fish | source ${lib.optionalString cfg.enableTransience "enable_transience"} end ''; diff --git a/tests/modules/programs/starship/fish_without_interactive.nix b/tests/modules/programs/starship/fish_without_interactive.nix index eeafb47e1..0ec8f9646 100644 --- a/tests/modules/programs/starship/fish_without_interactive.nix +++ b/tests/modules/programs/starship/fish_without_interactive.nix @@ -19,7 +19,7 @@ with lib; export GOT="$(tail -n 5 `_abs home-files/.config/fish/config.fish`)" export EXPECTED=" if test \"\$TERM\" != dumb - eval (/home/hm-user/.nix-profile/bin/starship init fish) + /home/hm-user/.nix-profile/bin/starship init fish | source end"