vuls: init at 0.27.0
[NixPkgs.git] / nixos / tests / starship.nix
blob48a4be6caf1760b3f6eefda74a398b7a2882d0c5
1 import ./make-test-python.nix ({ pkgs, ... }: {
2   name = "starship";
3   meta.maintainers = pkgs.starship.meta.maintainers;
5   nodes.machine = {
6     programs = {
7       fish.enable = true;
8       zsh.enable = true;
10       starship = {
11         enable = true;
12         settings.format = "<starship>";
13       };
14     };
16     environment.systemPackages = map
17       (shell: pkgs.writeScriptBin "expect-${shell}" ''
18         #!${pkgs.expect}/bin/expect -f
20         spawn env TERM=xterm ${shell} -i
22         expect "<starship>" {
23           send "exit\n"
24         } timeout {
25           send_user "\n${shell} failed to display Starship\n"
26           exit 1
27         }
29         expect eof
30       '')
31       [ "bash" "fish" "zsh" ];
32   };
34   testScript = ''
35     start_all()
36     machine.wait_for_unit("default.target")
38     machine.succeed("expect-bash")
39     machine.succeed("expect-fish")
40     machine.succeed("expect-zsh")
41   '';