Files
nixpkgs/nixos/tests/firefoxpwa.nix
2kybe3 cec1a8e6bd nixos/tests/firefoxpwa: ensure Jellyfin readiness and increase disk size
Add required VM disk space for Jellyfin (2 GiB) and wait for web manifest endpoint before installing PWA
2026-05-03 15:11:28 +02:00

45 lines
1.2 KiB
Nix

{ lib, ... }:
{
name = "firefoxpwa";
meta.maintainers = with lib.maintainers; [ camillemndn ];
nodes.machine =
{ pkgs, ... }:
{
imports = [ ./common/x11.nix ];
environment.systemPackages = with pkgs; [
firefoxpwa
jq
];
programs.firefox = {
enable = true;
nativeMessagingHosts.packages = [ pkgs.firefoxpwa ];
};
services.jellyfin.enable = true;
# Jellyfin requires at least 2 GB of disk space
virtualisation.diskSize = 3 * 1024; # 3 GB
};
enableOCR = true;
testScript = ''
machine.start()
with subtest("Wait for Jellyfin to be ready"):
machine.wait_for_unit("jellyfin.service")
machine.wait_for_open_port(8096)
machine.wait_until_succeeds("curl -fs http://localhost:8096/web/manifest.json")
with subtest("Install a progressive web app"):
machine.succeed("firefoxpwa site install http://localhost:8096/web/manifest.json >&2")
with subtest("Launch the progressive web app"):
machine.succeed("firefoxpwa site launch $(jq -r < ~/.local/share/firefoxpwa/config.json '.sites | keys[0]') >&2")
machine.wait_for_window("Jellyfin")
machine.wait_for_text("Jellyfin")
'';
}