2021-12-24 11:24:29 +00:00
|
|
|
import ./make-test-python.nix ({ pkgs, ... }: {
|
|
|
|
name = "starship";
|
|
|
|
meta.maintainers = pkgs.starship.meta.maintainers;
|
|
|
|
|
2022-03-20 23:15:30 +00:00
|
|
|
nodes.machine = {
|
2021-12-24 11:24:29 +00:00
|
|
|
programs = {
|
|
|
|
fish.enable = true;
|
|
|
|
zsh.enable = true;
|
|
|
|
|
|
|
|
starship = {
|
|
|
|
enable = true;
|
|
|
|
settings.format = "<starship>";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-01-12 19:43:52 +00:00
|
|
|
environment.systemPackages = map
|
|
|
|
(shell: pkgs.writeScriptBin "expect-${shell}" ''
|
|
|
|
#!${pkgs.expect}/bin/expect -f
|
|
|
|
|
|
|
|
spawn env TERM=xterm ${shell} -i
|
|
|
|
|
|
|
|
expect "<starship>" {
|
|
|
|
send "exit\n"
|
|
|
|
} timeout {
|
|
|
|
send_user "\n${shell} failed to display Starship\n"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
expect eof
|
|
|
|
'')
|
|
|
|
[ "bash" "fish" "zsh" ];
|
2021-12-24 11:24:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
|
|
|
start_all()
|
|
|
|
machine.wait_for_unit("default.target")
|
|
|
|
|
2022-01-12 19:43:52 +00:00
|
|
|
machine.succeed("expect-bash")
|
|
|
|
machine.succeed("expect-fish")
|
|
|
|
machine.succeed("expect-zsh")
|
2021-12-24 11:24:29 +00:00
|
|
|
'';
|
|
|
|
})
|