at master 1.0 kB view raw
1{ pkgs, ... }: 2 3{ 4 name = "cage"; 5 meta = with pkgs.lib.maintainers; { 6 maintainers = [ matthewbauer ]; 7 }; 8 9 nodes.machine = 10 { ... }: 11 12 { 13 imports = [ ./common/user-account.nix ]; 14 15 fonts.packages = with pkgs; [ dejavu_fonts ]; 16 17 services.cage = { 18 enable = true; 19 user = "alice"; 20 program = "${pkgs.xterm}/bin/xterm"; 21 }; 22 23 # Need to switch to a different GPU driver than the default one (-vga std) so that Cage can launch: 24 virtualisation.qemu.options = [ "-vga none -device virtio-gpu-pci" ]; 25 }; 26 27 enableOCR = true; 28 29 testScript = 30 { nodes, ... }: 31 let 32 user = nodes.machine.config.users.users.alice; 33 in 34 '' 35 with subtest("Wait for cage to boot up"): 36 start_all() 37 machine.wait_for_file("/run/user/${toString user.uid}/wayland-0.lock") 38 machine.wait_until_succeeds("pgrep xterm") 39 machine.wait_for_text("alice@machine") 40 machine.screenshot("screen") 41 ''; 42}