pytrainer: unpin python 3.10
[NixPkgs.git] / pkgs / by-name / lx / lxd-ui / package.nix
blob9b613325c328a579aa5856810881330ef11442e9
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   fetchYarnDeps,
6   nodejs,
7   fixup-yarn-lock,
8   yarn,
9   nixosTests,
10   nix-update-script,
13 stdenv.mkDerivation rec {
14   pname = "lxd-ui";
15   version = "0.12";
17   src = fetchFromGitHub {
18     owner = "canonical";
19     repo = "lxd-ui";
20     rev = "refs/tags/${version}";
21     hash = "sha256-dVTUme+23HaONcvfcgen/y1S0D91oYmgGLGfRcAMJSw=";
22   };
24   offlineCache = fetchYarnDeps {
25     yarnLock = "${src}/yarn.lock";
26     hash = "sha256-lPBkGKK6C6C217wqvOoC7on/Dzmk3NkdIkMDMF9CRNQ=";
27   };
29   nativeBuildInputs = [
30     nodejs
31     fixup-yarn-lock
32     yarn
33   ];
35   configurePhase = ''
36     runHook preConfigure
38     export HOME=$(mktemp -d)
39     yarn config --offline set yarn-offline-mirror "$offlineCache"
40     fixup-yarn-lock yarn.lock
41     yarn --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive install
42     patchShebangs node_modules
44     runHook postConfigure
45   '';
47   buildPhase = ''
48     runHook preBuild
50     yarn --offline build
52     runHook postBuild
53   '';
55   installPhase = ''
56     runHook preInstall
58     cp -r build/ui/ $out
60     runHook postInstall
61   '';
63   passthru.tests.default = nixosTests.lxd.ui;
64   passthru.updateScript = nix-update-script { };
66   meta = {
67     description = "Web user interface for LXD";
68     homepage = "https://github.com/canonical/lxd-ui";
69     changelog = "https://github.com/canonical/lxd-ui/releases/tag/${version}";
70     license = lib.licenses.gpl3;
71     maintainers = [ ];
72     platforms = lib.platforms.linux;
73   };