1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-26 19:59:47 +01:00
home-manager/tests/modules/programs/starship/fish_with_interactive.nix
eljamm 86ee1290d7
starship: add enableInteractive option for fish
Some fish plugins such as https://github.com/acomagu/fish-async-prompt
require that starship be initialized as non-interactive.

When the `programs.starship.enableInteractive` option is enabled,
starship is initialized at the end of the init script, outside the
interactive block.
2024-12-05 00:19:44 +01:00

27 lines
598 B
Nix

{ config, lib, pkgs, ... }:
with lib;
{
config = {
programs = {
fish.enable = true;
starship.enable = true;
};
nmt.script = ''
assertFileExists home-files/.config/fish/config.fish
export GOT="$(tail -n 5 `_abs home-files/.config/fish/config.fish`)"
export NOT_EXPECTED="
if test \"\$TERM\" != dumb
/home/hm-user/.nix-profile/bin/starship init fish | source
end"
if [[ "$GOT" == "$NOT_EXPECTED" ]]; then
fail "Expected starship init to be inside the 'is-interactive' block but it wasn't."
fi
'';
};
}