From 2e7e845b54696c00a66c5837aaec68fd763513e1 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Sat, 28 Dec 2024 00:31:00 +0100 Subject: [PATCH] flake: remove ustreamer stuff as it's in unstable Signed-off-by: Sefa Eyeoglu --- .../andromeda/configuration.nix | 1 - nixosModules/default.nix | 1 - nixosModules/ustreamer.nix | 112 ------------------ pkgs/default.nix | 4 - pkgs/ustreamer.nix | 94 --------------- 5 files changed, 212 deletions(-) delete mode 100644 nixosModules/ustreamer.nix delete mode 100644 pkgs/ustreamer.nix diff --git a/nixosConfigurations/andromeda/configuration.nix b/nixosConfigurations/andromeda/configuration.nix index b3864568..fbc7297d 100644 --- a/nixosConfigurations/andromeda/configuration.nix +++ b/nixosConfigurations/andromeda/configuration.nix @@ -17,7 +17,6 @@ inputs.nixos-hardware.nixosModules.common-gpu-amd inputs.nixos-hardware.nixosModules.common-pc-ssd inputs.srvos.nixosModules.desktop - inputs.self.nixosModules.ustreamer ]; facter.reportPath = ./facter.json; diff --git a/nixosModules/default.nix b/nixosModules/default.nix index 0efd275e..a6d9fcad 100644 --- a/nixosModules/default.nix +++ b/nixosModules/default.nix @@ -2,6 +2,5 @@ flake.nixosModules = { borgbase = ./borgbase.nix; oci-image-external = ./oci-image-external.nix; - ustreamer = ./ustreamer.nix; }; } diff --git a/nixosModules/ustreamer.nix b/nixosModules/ustreamer.nix deleted file mode 100644 index 38c802f6..00000000 --- a/nixosModules/ustreamer.nix +++ /dev/null @@ -1,112 +0,0 @@ -{ - config, - lib, - pkgs, - utils, - ... -}: let - inherit - (lib) - getExe - mkEnableOption - mkIf - mkOption - mkPackageOption - optionals - types - ; - - cfg = config.services.ustreamer; -in { - options.services.ustreamer = { - enable = mkEnableOption "µStreamer, a lightweight MJPEG-HTTP streamer"; - - package = mkPackageOption pkgs "ustreamer" {}; - - autoStart = mkOption { - description = '' - Wether to start µStreamer on boot. Disabling this will use socket - activation. The service will stop gracefully after some inactivity. - Disabling this will set `--exit-on-no-clients=300` - ''; - type = types.bool; - default = true; - example = false; - }; - - listenAddress = mkOption { - description = '' - Address to expose the HTTP server. This accepts values for - ListenStream= defined in {manpage}`systemd.socket(5)` - ''; - type = types.str; - default = "0.0.0.0:8080"; - example = "/run/ustreamer.sock"; - }; - - device = mkOption { - description = '' - The v4l2 device to stream. - ''; - type = types.path; - default = "/dev/video0"; - example = "/dev/v4l/by-id/usb-0000_Dummy_abcdef-video-index0"; - }; - - extraArgs = mkOption { - description = '' - Extra arguments to pass to `ustreamer`. See {manpage}`ustreamer(1)` - ''; - type = with types; listOf str; - default = []; - example = ["--resolution=1920x1080"]; - }; - }; - - config = mkIf cfg.enable { - services.ustreamer.extraArgs = - [ - "--device=${cfg.device}" - ] - ++ optionals (!cfg.autoStart) [ - "--exit-on-no-clients=300" - ]; - - systemd.services."ustreamer" = { - description = "µStreamer, a lightweight MJPEG-HTTP streamer"; - after = ["network.target"]; - requires = ["ustreamer.socket"]; - wantedBy = mkIf cfg.autoStart ["multi-user.target"]; - serviceConfig = { - ExecStart = utils.escapeSystemdExecArgs ( - [ - (getExe cfg.package) - "--systemd" - ] - ++ cfg.extraArgs - ); - Restart = - if cfg.autoStart - then "always" - else "on-failure"; - - DynamicUser = true; - SupplementaryGroups = ["video"]; - - NoNewPrivileges = true; - ProcSubset = "pid"; - ProtectProc = "noaccess"; - ProtectClock = "yes"; - DeviceAllow = [cfg.device]; - }; - }; - - systemd.sockets."ustreamer" = { - wantedBy = ["sockets.target"]; - partOf = ["ustreamer.service"]; - socketConfig = { - ListenStream = cfg.listenAddress; - }; - }; - }; -} diff --git a/pkgs/default.nix b/pkgs/default.nix index 57d8a64d..06e3b412 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -12,8 +12,6 @@ banana-pi-r4-firmware = pkgs.callPackage ./banana-pi-r4-firmware.nix { uboot = config.packages.uboot-bpir4; }; - - ustreamer = pkgs.callPackage ./ustreamer.nix {}; }; }; flake.overlays.default = final: prev: { @@ -24,7 +22,5 @@ banana-pi-r4-firmware = final.callPackage ./banana-pi-r4-firmware.nix { uboot = final.uboot-bpir4; }; - - ustreamer = final.callPackage ./ustreamer.nix {}; }; } diff --git a/pkgs/ustreamer.nix b/pkgs/ustreamer.nix deleted file mode 100644 index 6dc653f9..00000000 --- a/pkgs/ustreamer.nix +++ /dev/null @@ -1,94 +0,0 @@ -{ - lib, - stdenv, - fetchFromGitHub, - libbsd, - libevent, - libjpeg, - libdrm, - pkg-config, - janus-gateway, - glib, - alsa-lib, - speex, - jansson, - libopus, - nixosTests, - systemdLibs, - which, - withSystemd ? true, - withJanus ? true, -}: -stdenv.mkDerivation rec { - pname = "ustreamer"; - version = "6.18"; - - src = fetchFromGitHub { - owner = "pikvm"; - repo = "ustreamer"; - rev = "v${version}"; - hash = "sha256-VzhTfr0Swrv3jZUvBYYy5l0+iSokIztpeyA1CuG/roY="; - }; - - buildInputs = - [ - libbsd - libevent - libjpeg - libdrm - ] - ++ lib.optionals withSystemd [ - systemdLibs - ] - ++ lib.optionals withJanus [ - janus-gateway - glib - alsa-lib - jansson - speex - libopus - ]; - - nativeBuildInputs = [ - pkg-config - which - ]; - - makeFlags = - [ - "PREFIX=${placeholder "out"}" - "WITH_V4P=1" - ] - ++ lib.optionals withSystemd [ - "WITH_SYSTEMD=1" - ] - ++ lib.optionals withJanus [ - "WITH_JANUS=1" - # Workaround issues with Janus C Headers - # https://github.com/pikvm/ustreamer/blob/793f24c4/docs/h264.md#fixing-janus-c-headers - "CFLAGS=-I${lib.getDev janus-gateway}/include/janus" - ]; - - enableParallelBuilding = true; - - passthru.tests = {inherit (nixosTests) ustreamer;}; - - meta = with lib; { - homepage = "https://github.com/pikvm/ustreamer"; - description = "Lightweight and fast MJPG-HTTP streamer"; - longDescription = '' - µStreamer is a lightweight and very quick server to stream MJPG video from - any V4L2 device to the net. All new browsers have native support of this - video format, as well as most video players such as mplayer, VLC etc. - µStreamer is a part of the Pi-KVM project designed to stream VGA and HDMI - screencast hardware data with the highest resolution and FPS possible. - ''; - license = licenses.gpl3Plus; - maintainers = with maintainers; [ - tfc - matthewcroughan - ]; - platforms = platforms.linux; - mainProgram = "ustreamer"; - }; -} -- 2.51.2