mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 23:43:30 +00:00
59 lines
1.3 KiB
Nix
59 lines
1.3 KiB
Nix
{ lib, stdenv, dpkg, fetchurl, zip, nixosTests }:
|
|
|
|
let
|
|
generic = { version, sha256, suffix ? "", ... } @ 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 ];
|
|
};
|
|
});
|
|
|
|
in rec {
|
|
# see https://community.ui.com/releases / https://www.ui.com/download/unifi
|
|
|
|
unifi7 = generic {
|
|
version = "7.5.187";
|
|
suffix = "-f57f5bf7ab";
|
|
sha256 = "sha256-a5kl8gZbRnhS/p1imPl7soM0/QSFHdM0+2bNmDfc1mY=";
|
|
};
|
|
|
|
unifi8 = generic {
|
|
version = "8.1.127";
|
|
sha256 = "sha256-7Xg4I0Kuvta4oKzkduCda7aonTFzutrQJK03FLqM0KE=";
|
|
};
|
|
}
|