Skip to content

Commit

Permalink
nixos/ustreamer: update test to use module
Browse files Browse the repository at this point in the history
Signed-off-by: Sefa Eyeoglu <[email protected]>
  • Loading branch information
Scrumplex committed Dec 24, 2024
1 parent 8b261d0 commit 813b1d3
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions nixos/tests/ustreamer.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,13 @@ import ./make-test-python.nix (
'';
in
{
environment.systemPackages = [ pkgs.ustreamer ];
networking.firewall.enable = false;
systemd.services.ustreamer = {
description = "ustreamer service";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
DynamicUser = true;
ExecStart = "${pkgs.ustreamer}/bin/ustreamer --host=0.0.0.0 --port 8000 --device /dev/video9 --device-timeout=8";
PrivateTmp = true;
BindReadOnlyPaths = "/dev/video9";
SupplementaryGroups = [
"video"
];
Restart = "always";
};
services.ustreamer = {
enable = true;
device = "/dev/video9";
extraArgs = [ "--device-timeout=8" ];
};
networking.firewall.allowedTCPPorts = [ 8080 ];

boot.extraModulePackages = [ config.boot.kernelPackages.akvcam ];
boot.kernelModules = [ "akvcam" ];
boot.extraModprobeConfig = ''
Expand All @@ -74,10 +65,10 @@ import ./make-test-python.nix (
start_all()
camera.wait_for_unit("ustreamer.service")
camera.wait_for_open_port(8000)
camera.wait_for_open_port(8080)
client.wait_for_unit("multi-user.target")
client.succeed("curl http://camera:8000")
client.succeed("curl http://camera:8080")
'';
}
)

0 comments on commit 813b1d3

Please sign in to comment.