at master 993 B view raw
1{ pkgs, ... }: 2{ 3 name = "starship"; 4 meta.maintainers = pkgs.starship.meta.maintainers; 5 6 nodes.machine = { 7 programs = { 8 fish.enable = true; 9 zsh.enable = true; 10 11 starship = { 12 enable = true; 13 settings.format = "<starship>"; 14 }; 15 }; 16 17 environment.systemPackages = 18 map 19 ( 20 shell: 21 pkgs.writeScriptBin "expect-${shell}" '' 22 #!${pkgs.expect}/bin/expect -f 23 24 spawn env TERM=xterm ${shell} -i 25 26 expect "<starship>" { 27 send "exit\n" 28 } timeout { 29 send_user "\n${shell} failed to display Starship\n" 30 exit 1 31 } 32 33 expect eof 34 '' 35 ) 36 [ 37 "bash" 38 "fish" 39 "zsh" 40 ]; 41 }; 42 43 testScript = '' 44 start_all() 45 machine.wait_for_unit("default.target") 46 47 machine.succeed("expect-bash") 48 machine.succeed("expect-fish") 49 machine.succeed("expect-zsh") 50 ''; 51}