diff --git a/pkgs/by-name/un/unifi/package.nix b/pkgs/by-name/un/unifi/package.nix new file mode 100644 index 000000000000..14ff55384314 --- /dev/null +++ b/pkgs/by-name/un/unifi/package.nix @@ -0,0 +1,53 @@ +{ + lib, + stdenv, + dpkg, + fetchurl, + nixosTests, +}: + +stdenv.mkDerivation rec { + pname = "unifi-controller"; + version = "8.6.9"; + + # see https://community.ui.com/releases / https://www.ui.com/download/unifi + src = fetchurl { + url = "https://dl.ui.com/unifi/${version}/unifi_sysvinit_all.deb"; + sha256 = "sha256-004ZJEoj23FyFEBznqrpPzQ9E6DYpD7gBxa3ewSunIo="; + }; + + nativeBuildInputs = [ dpkg ]; + + unpackPhase = '' + runHook preUnpack + dpkg-deb -x $src ./ + runHook postUnpack + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out + cd ./usr/lib/unifi + cp -ar dl lib webapps $out + + runHook postInstall + ''; + + passthru.tests = { + unifi = nixosTests.unifi; + }; + + meta = with lib; { + homepage = "http://www.ubnt.com/"; + description = "Controller for Ubiquiti UniFi access points"; + sourceProvenance = with sourceTypes; [ binaryBytecode ]; + license = licenses.unfree; + platforms = platforms.unix; + maintainers = with maintainers; [ + globin + patryk27 + ]; + knownVulnerabilities = [ ]; + }; +} diff --git a/pkgs/servers/unifi/default.nix b/pkgs/servers/unifi/default.nix deleted file mode 100644 index 4875e072ca82..000000000000 --- a/pkgs/servers/unifi/default.nix +++ /dev/null @@ -1,54 +0,0 @@ -{ lib, stdenv, dpkg, fetchurl, zip, nixosTests }: - -let - generic = { version, sha256, suffix ? "", knownVulnerabilities ? [ ], ... } @ args: - stdenv.mkDerivation (args // { - pname = "unifi-controller"; - - src = fetchurl { - url = "https://dl.ubnt.com/unifi/${version}${suffix}/unifi_sysvinit_all.deb"; - inherit sha256; - }; - - nativeBuildInputs = [ dpkg ]; - - unpackPhase = '' - runHook preUnpack - dpkg-deb -x $src ./ - runHook postUnpack - ''; - - installPhase = '' - runHook preInstall - - mkdir -p $out - cd ./usr/lib/unifi - cp -ar dl lib webapps $out - - runHook postInstall - ''; - - passthru.tests = { - unifi = nixosTests.unifi; - }; - - meta = with lib; { - homepage = "http://www.ubnt.com/"; - description = "Controller for Ubiquiti UniFi access points"; - sourceProvenance = with sourceTypes; [ binaryBytecode ]; - license = licenses.unfree; - platforms = platforms.unix; - maintainers = with maintainers; [ globin patryk27 ]; - inherit knownVulnerabilities; - }; - }); - -in rec { - # see https://community.ui.com/releases / https://www.ui.com/download/unifi - - unifi8 = generic { - version = "8.5.6"; - suffix = "-1x29lm155t"; - sha256 = "sha256-ZpCoE8OPb3FcKzf7Nurf9q+g2BpbjZcp1LvWOsV/tpA="; - }; -} diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index bd21afa0c2d0..d84b67f44d01 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -1250,6 +1250,7 @@ mapAliases { unifi5 = throw "'unifi5' has been removed since its required MongoDB version is EOL."; # Added 2024-04-11 unifi6 = throw "'unifi6' has been removed since its required MongoDB version is EOL."; # Added 2024-04-11 unifi7 = throw "'unifi7' has been removed since it is vulnerable to CVE-2024-42025 and its required MongoDB version is EOL."; # Added 2024-10-01 + unifi8 = unifi; # Added 2024-11-15 unifiLTS = throw "'unifiLTS' has been removed since UniFi no longer has LTS and stable releases. Use `pkgs.unifi` instead."; # Added 2024-04-11 unifiStable = throw "'unifiStable' has been removed since UniFi no longer has LTS and stable releases. Use `pkgs.unifi` instead."; # Converted to throw 2024-04-11 untrunc = throw "'untrunc' has been renamed to/replaced by 'untrunc-anthwlock'"; # Converted to throw 2024-10-17 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a66e9bb794a9..efa448c47cd0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12348,11 +12348,6 @@ with pkgs; matomo_5 matomo-beta; - inherit (callPackages ../servers/unifi { }) - unifi8; - - unifi = unifi8; - unpackerr = callPackage ../servers/unpackerr { inherit (darwin.apple_sdk.frameworks) Cocoa WebKit; };