1{ pkgs, lib, ... }:
2{
3 name = "morph-browser-standalone";
4 meta.maintainers = lib.teams.lomiri.members;
5
6 nodes.machine =
7 { config, pkgs, ... }:
8 {
9 imports = [
10 ./common/x11.nix
11 ];
12
13 services.xserver.enable = true;
14
15 environment = {
16 systemPackages = with pkgs.lomiri; [
17 suru-icon-theme
18 morph-browser
19 ];
20 variables = {
21 UITK_ICON_THEME = "suru";
22 };
23 };
24
25 i18n.supportedLocales = [ "all" ];
26
27 fonts.packages = with pkgs; [
28 # Intended font & helps with OCR
29 ubuntu-classic
30 ];
31 };
32
33 enableOCR = true;
34
35 testScript = ''
36 machine.wait_for_x()
37
38 with subtest("morph browser launches"):
39 machine.execute("morph-browser >&2 &")
40 machine.wait_for_text(r"Web Browser|New|sites|Bookmarks")
41 machine.screenshot("morph_open")
42
43 with subtest("morph browser displays HTML"):
44 machine.send_chars("file://${pkgs.valgrind.doc}/share/doc/valgrind/html/index.html\n")
45 machine.wait_for_text("Valgrind Documentation")
46 machine.screenshot("morph_htmlcontent")
47
48 machine.succeed("pkill -f morph-browser")
49
50 with subtest("morph browser localisation works"):
51 machine.execute("env LANG=de_DE.UTF-8 morph-browser >&2 &")
52 machine.wait_for_text(r"Web-Browser|Neuer|Seiten|Lesezeichen")
53 machine.screenshot("morph_localised")
54 '';
55}