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;