2024-04-21 15:54:59 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fetchYarnDeps,
|
|
|
|
nodejs,
|
|
|
|
fixup-yarn-lock,
|
|
|
|
yarn,
|
|
|
|
nixosTests,
|
|
|
|
nix-update-script,
|
2023-07-15 17:15:38 +00:00
|
|
|
}:
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2023-07-15 17:15:38 +00:00
|
|
|
pname = "lxd-ui";
|
2024-06-24 18:47:55 +00:00
|
|
|
version = "0.9";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "canonical";
|
|
|
|
repo = "lxd-ui";
|
2023-10-19 13:55:26 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-06-24 18:47:55 +00:00
|
|
|
hash = "sha256-4TIi/LPm35W86p+l5eYU0VETjno8TKmp43m2SReKElM=";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
offlineCache = fetchYarnDeps {
|
|
|
|
yarnLock = "${src}/yarn.lock";
|
2024-06-24 18:47:55 +00:00
|
|
|
hash = "sha256-wExAVEl745X4O9hYhKYX2BjmW494Vr13X8bDmVxKMT4=";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
nodejs
|
2024-04-21 15:54:59 +00:00
|
|
|
fixup-yarn-lock
|
2024-01-02 11:29:13 +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-15 17:15:38 +00:00
|
|
|
buildPhase = ''
|
2024-01-02 11:29:13 +00:00
|
|
|
runHook preBuild
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
yarn --offline build
|
2024-01-02 11:29:13 +00:00
|
|
|
|
|
|
|
runHook postBuild
|
2023-07-15 17:15:38 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2024-01-02 11:29:13 +00:00
|
|
|
runHook preInstall
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
cp -r build/ui/ $out
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
passthru.tests.default = nixosTests.lxd.ui;
|
2024-04-21 15:54:59 +00:00
|
|
|
passthru.updateScript = nix-update-script { };
|
2024-01-25 14:12:00 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
meta = {
|
2024-01-13 08:15:51 +00:00
|
|
|
description = "Web user interface for LXD";
|
2023-08-04 22:07:22 +00:00
|
|
|
homepage = "https://github.com/canonical/lxd-ui";
|
2024-04-21 15:54:59 +00:00
|
|
|
changelog = "https://github.com/canonical/lxd-ui/releases/tag/${version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
license = lib.licenses.gpl3;
|
2024-01-02 11:29:13 +00:00
|
|
|
maintainers = lib.teams.lxc.members;
|
2023-07-15 17:15:38 +00:00
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
};
|
|
|
|
}
|