vscode-extensions.capatech.betacode: init at 0.1.10 (#355720)
[NixPkgs.git] / pkgs / servers / unifi / default.nix
blob4875e072ca8226d906cf14736d51399d523d474d
1 { lib, stdenv, dpkg, fetchurl, zip, nixosTests }:
3 let
4   generic = { version, sha256, suffix ? "", knownVulnerabilities ? [ ], ... } @ args:
5   stdenv.mkDerivation (args // {
6     pname = "unifi-controller";
8     src = fetchurl {
9       url = "https://dl.ubnt.com/unifi/${version}${suffix}/unifi_sysvinit_all.deb";
10       inherit sha256;
11     };
13     nativeBuildInputs = [ dpkg ];
15     unpackPhase = ''
16       runHook preUnpack
17       dpkg-deb -x $src ./
18       runHook postUnpack
19     '';
21     installPhase = ''
22       runHook preInstall
24       mkdir -p $out
25       cd ./usr/lib/unifi
26       cp -ar dl lib webapps $out
28       runHook postInstall
29     '';
31     passthru.tests = {
32       unifi = nixosTests.unifi;
33     };
35     meta = with lib; {
36       homepage = "http://www.ubnt.com/";
37       description = "Controller for Ubiquiti UniFi access points";
38       sourceProvenance = with sourceTypes; [ binaryBytecode ];
39       license = licenses.unfree;
40       platforms = platforms.unix;
41       maintainers = with maintainers; [ globin patryk27 ];
42       inherit knownVulnerabilities;
43     };
44   });
46 in rec {
47   # see https://community.ui.com/releases / https://www.ui.com/download/unifi
49   unifi8 = generic {
50     version = "8.5.6";
51     suffix = "-1x29lm155t";
52     sha256 = "sha256-ZpCoE8OPb3FcKzf7Nurf9q+g2BpbjZcp1LvWOsV/tpA=";
53   };