summary refs log blame commit diff
path: root/nixos/tests/mpv.nix
blob: a4803f3cb5b55ae4dcb75ef297ff0c6cceef3e73 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16















                                                   
                                          





                                                         
                                                                                    



                                                                                    
import ./make-test-python.nix ({ lib, ... }:

with lib;

let
  port = toString 4321;
in
{
  name = "mpv";
  meta.maintainers = with maintainers; [ zopieux ];

  nodes.machine =
    { pkgs, ... }:
    {
      environment.systemPackages = [
        pkgs.curl
        (pkgs.wrapMpv pkgs.mpv-unwrapped {
          scripts = [ pkgs.mpvScripts.simple-mpv-webui ];
        })
      ];
    };

  testScript = ''
    machine.execute("set -m; mpv --script-opts=webui-port=${port} --idle=yes >&2 &")
    machine.wait_for_open_port(${port})
    assert "<title>simple-mpv-webui" in machine.succeed("curl -s localhost:${port}")
  '';
})