blob: 6934dbc35d45f708aa71f867f20f041aadcd7d0d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
{ lib, ... }:
let
port = toString 4321;
in
{
name = "mpv";
meta.maintainers = with lib.maintainers; [ zopieux ];
nodes.machine =
{ pkgs, ... }:
{
environment.systemPackages = [
pkgs.curl
(pkgs.mpv.override {
scripts = [ pkgs.mpvScripts.simple-mpv-webui ];
})
];
environment.etc."mpv/mpv.conf".text = ''
[nixos-test-profile]
'';
};
testScript = ''
machine.succeed("mpv --profile=help | grep -F nixos-test-profile")
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}")
'';
}
|