nixpkgs/pkgs/tools/admin/lxd/ui.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

68 lines
1.3 KiB
Nix
Raw Normal View History

2023-11-22 15:32:09 +01:00
{ lib
, stdenv
, fetchFromGitHub
, fetchYarnDeps
2023-11-22 15:32:09 +01:00
, nodejs
, prefetch-yarn-deps
, yarn
}:
2023-11-22 15:32:09 +01:00
stdenv.mkDerivation rec {
pname = "lxd-ui";
2023-11-22 15:32:09 +01:00
version = "0.4";
src = fetchFromGitHub {
owner = "canonical";
repo = "lxd-ui";
rev = "refs/tags/${version}";
2023-11-22 15:32:09 +01:00
hash = "sha256-l9Fp/Vm7NxMCp5QcM8+frFyfahhPG7TyF6NhfU1SEaA=";
};
offlineCache = fetchYarnDeps {
yarnLock = "${src}/yarn.lock";
2023-11-22 15:32:09 +01:00
hash = "sha256-R6OeaBC6xBHa229YGyc2LDjjenwvS805PW8ueU/o99I=";
};
2023-11-22 15:32:09 +01:00
nativeBuildInputs = [
nodejs
prefetch-yarn-deps
yarn
];
configurePhase = ''
runHook preConfigure
export HOME=$(mktemp -d)
yarn config --offline set yarn-offline-mirror "$offlineCache"
fixup-yarn-lock yarn.lock
yarn --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive install
patchShebangs node_modules
runHook postConfigure
'';
buildPhase = ''
2023-11-22 15:32:09 +01:00
runHook preBuild
yarn --offline build
2023-11-22 15:32:09 +01:00
runHook postBuild
'';
installPhase = ''
2023-11-22 15:32:09 +01:00
runHook preInstall
2023-11-22 15:32:09 +01:00
cp -r build/ui/ $out
runHook postInstall
'';
meta = {
description = "Web user interface for LXD.";
2023-07-19 15:16:20 +02:00
homepage = "https://github.com/canonical/lxd-ui";
license = lib.licenses.gpl3;
maintainers = with lib.maintainers; [ jnsgruk ];
platforms = lib.platforms.linux;
};
}