at master 2.1 kB view raw
1{ pkgs, ... }: 2let 3 pin = "1234"; 4in 5{ 6 name = "phosh"; 7 meta = with pkgs.lib.maintainers; { 8 maintainers = [ zhaofengli ]; 9 }; 10 11 nodes = { 12 phone = 13 { config, pkgs, ... }: 14 { 15 users.users.nixos = { 16 isNormalUser = true; 17 password = pin; 18 }; 19 20 services.xserver.desktopManager.phosh = { 21 enable = true; 22 user = "nixos"; 23 group = "users"; 24 25 phocConfig = { 26 outputs.Virtual-1 = { 27 scale = 2; 28 }; 29 }; 30 }; 31 32 environment.systemPackages = [ 33 pkgs.phosh-mobile-settings 34 ]; 35 36 systemd.services.phosh = { 37 environment = { 38 # Accelerated graphics fail on phoc 0.20 (wlroots 0.15) 39 "WLR_RENDERER" = "pixman"; 40 }; 41 }; 42 43 virtualisation.resolution = { 44 x = 720; 45 y = 1440; 46 }; 47 virtualisation.qemu.options = [ "-vga none -device virtio-gpu-pci,xres=720,yres=1440" ]; 48 }; 49 }; 50 51 enableOCR = true; 52 53 testScript = '' 54 import time 55 56 start_all() 57 phone.wait_for_unit("phosh.service") 58 59 with subtest("Check that we can see the lock screen info page"): 60 # Saturday, January 1 61 phone.succeed("timedatectl set-time '2022-01-01 07:00'") 62 63 phone.wait_for_text("Saturday") 64 phone.screenshot("01lockinfo") 65 66 with subtest("Check that we can unlock the screen"): 67 phone.send_chars("${pin}", delay=0.2) 68 time.sleep(1) 69 phone.screenshot("02unlock") 70 71 phone.send_chars("\n") 72 73 phone.wait_for_text("All Apps") 74 phone.screenshot("03launcher") 75 76 with subtest("Check the on-screen keyboard shows"): 77 phone.send_chars("mobile setting", delay=0.2) 78 phone.wait_for_text("123") # A button on the OSK 79 phone.screenshot("04osk") 80 81 with subtest("Check mobile-phosh-settings starts"): 82 phone.send_chars("\n") 83 phone.wait_for_text("Tweak advanced mobile settings"); 84 phone.screenshot("05settings") 85 ''; 86}