From 73609958b5282f512a11664898f2f2752d6fbc0b Mon Sep 17 00:00:00 2001 From: rsynnest Date: Thu, 22 Apr 2021 21:39:09 -0700 Subject: [PATCH] unifi-video: init at 3.10.13 --- pkgs/servers/unifi-video/default.nix | 61 ++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 63 insertions(+) create mode 100755 pkgs/servers/unifi-video/default.nix diff --git a/pkgs/servers/unifi-video/default.nix b/pkgs/servers/unifi-video/default.nix new file mode 100755 index 00000000000..4c55d510259 --- /dev/null +++ b/pkgs/servers/unifi-video/default.nix @@ -0,0 +1,61 @@ +{ dpkg +, stdenv +, lib +, fetchurl +, jre8 +, jsvc +, lsb-release +, libcap +, util-linux +, makeWrapper +, autoPatchelfHook +, glibc +, gcc-unwrapped +}: + +stdenv.mkDerivation rec { + pname = "unifi-video"; + version = "3.10.13"; + src = fetchurl { + urls = [ "https://dl.ui.com/firmwares/ufv/v${version}/unifi-video.Debian9_amd64.v${version}.deb" "https://archive.org/download/unifi-video.Debian9_amd64.v${version}/unifi-video.Debian9_amd64.v${version}.deb" ]; + sha256 = "06mxjdizs4mhm1by8kj4pg5hhdi8ns6x75ggwyp1k6zb26jvvdny"; + }; + + buildInputs = [ jre8 jsvc lsb-release libcap util-linux ]; + nativeBuildInputs = [ dpkg makeWrapper autoPatchelfHook glibc gcc-unwrapped ]; + + unpackCmd = '' + runHook preUnpack + + dpkg-deb -x $src . + rm -r etc + + runHook postUnpack + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out + cp -ar sbin $out/bin + cp -ar lib share $out + chmod +x $out/bin/* + wrapProgram $out/bin/unifi-video --set JAVA_HOME "${jre8}" --prefix PATH : ${lib.makeBinPath [ jre8 lsb-release libcap util-linux]} + + runHook postInstall + ''; + + meta = with lib; { + description = "Unifi Video NVR (aka Airvision) is a software package for controlling Unifi cameras"; + longDescription = '' + Unifi Video is the NVR server software which can monitor and + record footage from supported Unifi video cameras + ''; + homepage = "https://www.ui.com"; + downloadPage = "https://www.ui.com/download/unifi-video/"; + license = licenses.unfree; + maintainers = [ maintainers.rsynnest ]; + platforms = [ "x86_64-linux" ]; + knownVulnerabilities = [ "Upstream support for Unifi Video ended January 1st, 2021." ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c526c3706ab..7045912fb33 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19328,6 +19328,8 @@ in unifi6; unifi = unifi6; + unifi-video = callPackage ../servers/unifi-video { }; + urserver = callPackage ../servers/urserver { }; victoriametrics = callPackage ../servers/nosql/victoriametrics { };