1 import ./make-test-python.nix ({ pkgs, ... }: {
2 name = "ustreamer-vmtest";
5 environment.systemPackages = [ pkgs.curl ];
7 camera = {config, ...}: let
8 configFile = pkgs.writeText "akvcam-configFile" ''
12 cameras/1/type = output
13 cameras/1/mode = mmap, userptr, rw
14 cameras/1/description = Virtual Camera (output device)
18 cameras/2/type = capture
19 cameras/2/mode = mmap, rw
20 cameras/2/description = Virtual Camera
21 cameras/2/formats = 1, 2
26 connections/1/connection = 1:2
31 formats/1/format = YUY2
33 formats/1/height = 480
36 formats/2/format = RGB24, YUY2
38 formats/2/height = 480
39 formats/2/fps = 20/1, 15/2
42 environment.systemPackages = [ pkgs.ustreamer ];
43 networking.firewall.enable = false;
44 systemd.services.ustreamer = {
45 description = "ustreamer service";
46 wantedBy = ["multi-user.target"];
49 ExecStart = "${pkgs.ustreamer}/bin/ustreamer --host=0.0.0.0 --port 8000 --device /dev/video9 --device-timeout=8";
51 BindReadOnlyPaths = "/dev/video9";
52 SupplementaryGroups = [
58 boot.extraModulePackages = [config.boot.kernelPackages.akvcam];
59 boot.kernelModules = ["akvcam"];
60 boot.extraModprobeConfig = ''
61 options akvcam config_file=${configFile}
69 camera.wait_for_unit("ustreamer.service")
70 camera.wait_for_open_port(8000)
72 client.wait_for_unit("multi-user.target")
73 client.succeed("curl http://camera:8000")