mirror of
https://github.com/nix-community/home-manager
synced 2024-12-26 19:59:47 +01:00
86ee1290d7
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.
43 lines
749 B
Nix
43 lines
749 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
{
|
|
config = {
|
|
programs = {
|
|
fish.enable = true;
|
|
|
|
starship = {
|
|
enable = true;
|
|
enableInteractive = false;
|
|
};
|
|
};
|
|
|
|
nmt.script = ''
|
|
assertFileExists home-files/.config/fish/config.fish
|
|
|
|
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)
|
|
|
|
end"
|
|
|
|
export MESSAGE="
|
|
==========
|
|
Expected
|
|
==========
|
|
$EXPECTED
|
|
==========
|
|
Got
|
|
==========
|
|
$GOT
|
|
==========
|
|
"
|
|
|
|
if [[ "$GOT" != "$EXPECTED" ]]; then
|
|
fail "$MESSAGE"
|
|
fi
|
|
'';
|
|
};
|
|
}
|