From 48cef5f1c730b9e2b1f31f7360468404297e0407 Mon Sep 17 00:00:00 2001 From: Davis Schirmer Date: Fri, 15 Nov 2024 19:51:59 -0500 Subject: [PATCH 1/3] unifi: 8.5.6 -> 8.6.9 https://community.ui.com/releases/UniFi-Network-Application-8-6-9/e4bd3f71-a2c4-4c98-b12a-a8b0b1c2178e --- pkgs/servers/unifi/default.nix | 95 ++++++++++++++++----------------- pkgs/top-level/all-packages.nix | 5 +- 2 files changed, 49 insertions(+), 51 deletions(-) diff --git a/pkgs/servers/unifi/default.nix b/pkgs/servers/unifi/default.nix index 4875e072ca82..14ff55384314 100644 --- a/pkgs/servers/unifi/default.nix +++ b/pkgs/servers/unifi/default.nix @@ -1,54 +1,53 @@ -{ lib, stdenv, dpkg, fetchurl, zip, nixosTests }: +{ + lib, + stdenv, + dpkg, + fetchurl, + nixosTests, +}: -let - generic = { version, sha256, suffix ? "", knownVulnerabilities ? [ ], ... } @ args: - stdenv.mkDerivation (args // { - pname = "unifi-controller"; +stdenv.mkDerivation rec { + pname = "unifi-controller"; + version = "8.6.9"; - 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 + src = fetchurl { + url = "https://dl.ui.com/unifi/${version}/unifi_sysvinit_all.deb"; + sha256 = "sha256-004ZJEoj23FyFEBznqrpPzQ9E6DYpD7gBxa3ewSunIo="; + }; - unifi8 = generic { - version = "8.5.6"; - suffix = "-1x29lm155t"; - sha256 = "sha256-ZpCoE8OPb3FcKzf7Nurf9q+g2BpbjZcp1LvWOsV/tpA="; + 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/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index beb25b36d18a..606a3ec60351 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12348,10 +12348,9 @@ with pkgs; matomo_5 matomo-beta; - inherit (callPackages ../servers/unifi { }) - unifi8; + unifi = callPackage ../servers/unifi { }; - unifi = unifi8; + unifi8 = unifi; unpackerr = callPackage ../servers/unpackerr { inherit (darwin.apple_sdk.frameworks) Cocoa WebKit; From 0fcf5c1a61eb483502e55bbd83a1c428f43a6832 Mon Sep 17 00:00:00 2001 From: Davis Schirmer Date: Fri, 15 Nov 2024 19:59:16 -0500 Subject: [PATCH 2/3] unifi: Move package to pkgs/by-name/un/unifi --- pkgs/{servers/unifi/default.nix => by-name/un/unifi/package.nix} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename pkgs/{servers/unifi/default.nix => by-name/un/unifi/package.nix} (100%) diff --git a/pkgs/servers/unifi/default.nix b/pkgs/by-name/un/unifi/package.nix similarity index 100% rename from pkgs/servers/unifi/default.nix rename to pkgs/by-name/un/unifi/package.nix From e4f146380386deb42eaac733ff1a83aa1e83ed40 Mon Sep 17 00:00:00 2001 From: Davis Schirmer Date: Fri, 15 Nov 2024 19:57:13 -0500 Subject: [PATCH 3/3] unifi: Update aliases --- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) 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 606a3ec60351..2d2432d21f25 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12348,10 +12348,6 @@ with pkgs; matomo_5 matomo-beta; - unifi = callPackage ../servers/unifi { }; - - unifi8 = unifi; - unpackerr = callPackage ../servers/unpackerr { inherit (darwin.apple_sdk.frameworks) Cocoa WebKit; };