2024-04-02 03:25:42 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fetchYarnDeps,
|
|
|
|
nodejs,
|
2024-04-17 17:34:05 +00:00
|
|
|
fixup-yarn-lock,
|
2024-04-02 03:25:42 +00:00
|
|
|
yarn,
|
|
|
|
nixosTests,
|
2024-04-11 07:11:00 +00:00
|
|
|
nix-update-script,
|
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";
|
2024-07-23 09:05:16 +00:00
|
|
|
version = "0.12";
|
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}";
|
2024-07-23 09:05:16 +00:00
|
|
|
hash = "sha256-dVTUme+23HaONcvfcgen/y1S0D91oYmgGLGfRcAMJSw=";
|
2023-07-03 16:56:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
offlineCache = fetchYarnDeps {
|
|
|
|
yarnLock = "${src}/yarn.lock";
|
2024-07-23 09:05:16 +00:00
|
|
|
hash = "sha256-lPBkGKK6C6C217wqvOoC7on/Dzmk3NkdIkMDMF9CRNQ=";
|
2023-07-03 16:56:25 +00:00
|
|
|
};
|
|
|
|
|
2023-11-22 14:32:09 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
nodejs
|
2024-04-17 17:34:05 +00:00
|
|
|
fixup-yarn-lock
|
2023-11-22 14:32:09 +00:00
|
|
|
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
|
|
|
|
2024-01-15 08:59:17 +00:00
|
|
|
passthru.tests.default = nixosTests.lxd.ui;
|
2024-04-11 07:11:00 +00:00
|
|
|
passthru.updateScript = nix-update-script { };
|
2024-01-15 08:59:17 +00:00
|
|
|
|
2023-07-03 16:56:25 +00:00
|
|
|
meta = {
|
2024-01-08 05:29:45 +00:00
|
|
|
description = "Web user interface for LXD";
|
2023-07-19 13:16:20 +00:00
|
|
|
homepage = "https://github.com/canonical/lxd-ui";
|
2024-04-11 07:11:00 +00:00
|
|
|
changelog = "https://github.com/canonical/lxd-ui/releases/tag/${version}";
|
2023-07-03 16:56:25 +00:00
|
|
|
license = lib.licenses.gpl3;
|
2023-12-02 14:38:44 +00:00
|
|
|
maintainers = lib.teams.lxc.members;
|
2023-07-03 16:56:25 +00:00
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
};
|
|
|
|
}
|