1{ lib, ... }:
2
3{
4 name = "firefoxpwa";
5 meta.maintainers = with lib.maintainers; [ camillemndn ];
6
7 nodes.machine =
8 { pkgs, ... }:
9 {
10 imports = [ ./common/x11.nix ];
11 environment.systemPackages = with pkgs; [
12 firefoxpwa
13 jq
14 ];
15
16 programs.firefox = {
17 enable = true;
18 nativeMessagingHosts.packages = [ pkgs.firefoxpwa ];
19 };
20
21 services.jellyfin.enable = true;
22 };
23
24 enableOCR = true;
25
26 testScript = ''
27 machine.start()
28
29 with subtest("Install a progressive web app"):
30 machine.wait_for_unit("jellyfin.service")
31 machine.wait_for_open_port(8096)
32 machine.succeed("firefoxpwa site install http://localhost:8096/web/manifest.json >&2")
33
34 with subtest("Launch the progressive web app"):
35 machine.succeed("firefoxpwa site launch $(jq -r < ~/.local/share/firefoxpwa/config.json '.sites | keys[0]') >&2")
36 machine.wait_for_window("Jellyfin")
37 machine.wait_for_text("Jellyfin")
38 '';
39}