2023-11-22 14:32:09 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2023-07-03 16:56:25 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchYarnDeps
|
2023-11-22 14:32:09 +00:00
|
|
|
, nodejs
|
|
|
|
, prefetch-yarn-deps
|
|
|
|
, yarn
|
2023-07-03 16:56:25 +00:00
|
|
|
}:
|
|
|
|
|
2023-11-22 14:32:09 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2023-07-03 16:56:25 +00:00
|
|
|
pname = "lxd-ui";
|
2023-12-01 13:28:12 +00:00
|
|
|
version = "0.5";
|
2023-07-03 16:56:25 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "canonical";
|
|
|
|
repo = "lxd-ui";
|
2023-10-09 18:19:17 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2023-12-01 13:28:12 +00:00
|
|
|
hash = "sha256-52MRf7bk8Un9wqz00+JjDmuJgPKYhgAhIbMbcAuf8W8=";
|
2023-07-03 16:56:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
offlineCache = fetchYarnDeps {
|
|
|
|
yarnLock = "${src}/yarn.lock";
|
2023-12-01 13:28:12 +00:00
|
|
|
hash = "sha256-WWnNjwzhN57PzTPmLWWzPoj66VFUnuzW1hTjKlVV8II=";
|
2023-07-03 16:56:25 +00:00
|
|
|
};
|
|
|
|
|
2023-11-22 14:32:09 +00: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
|
|
|
|
'';
|
|
|
|
|
2023-07-03 16:56:25 +00:00
|
|
|
buildPhase = ''
|
2023-11-22 14:32:09 +00:00
|
|
|
runHook preBuild
|
|
|
|
|
2023-07-03 16:56:25 +00:00
|
|
|
yarn --offline build
|
2023-11-22 14:32:09 +00:00
|
|
|
|
|
|
|
runHook postBuild
|
2023-07-03 16:56:25 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2023-11-22 14:32:09 +00:00
|
|
|
runHook preInstall
|
2023-07-03 16:56:25 +00:00
|
|
|
|
2023-11-22 14:32:09 +00:00
|
|
|
cp -r build/ui/ $out
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
2023-07-03 16:56:25 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Web user interface for LXD.";
|
2023-07-19 13:16:20 +00:00
|
|
|
homepage = "https://github.com/canonical/lxd-ui";
|
2023-07-03 16:56:25 +00:00
|
|
|
license = lib.licenses.gpl3;
|
|
|
|
maintainers = with lib.maintainers; [ jnsgruk ];
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
};
|
|
|
|
}
|