nixpkgs/pkgs/by-name/lx/lxd-ui/package.nix

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

75 lines
1.5 KiB
Nix
Raw Normal View History

{
lib,
stdenv,
fetchFromGitHub,
fetchYarnDeps,
nodejs,
fixup-yarn-lock,
yarn,
nixosTests,
nix-update-script,
}:
2023-11-22 14:32:09 +00:00
stdenv.mkDerivation rec {
pname = "lxd-ui";
2024-12-11 19:29:57 +00:00
version = "0.14";
src = fetchFromGitHub {
owner = "canonical";
repo = "lxd-ui";
rev = "refs/tags/${version}";
2024-12-11 19:29:57 +00:00
hash = "sha256-mrJpoD8eq/LxZl0JJ0ZqnAvMqqNGqRfi9UUh40PD0TY=";
};
offlineCache = fetchYarnDeps {
yarnLock = "${src}/yarn.lock";
2024-12-11 19:29:57 +00:00
hash = "sha256-dkATFNjAPhrPbXhcJ/R4eIpcagKEwBSnRfLwqTPIe6c=";
};
2023-11-22 14:32:09 +00:00
nativeBuildInputs = [
nodejs
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
'';
buildPhase = ''
2023-11-22 14:32:09 +00:00
runHook preBuild
yarn --offline build
2023-11-22 14:32:09 +00:00
runHook postBuild
'';
installPhase = ''
2023-11-22 14:32:09 +00:00
runHook preInstall
2023-11-22 14:32:09 +00:00
cp -r build/ui/ $out
runHook postInstall
'';
passthru.tests.default = nixosTests.lxd.ui;
passthru.updateScript = nix-update-script { };
meta = {
description = "Web user interface for LXD";
2023-07-19 13:16:20 +00:00
homepage = "https://github.com/canonical/lxd-ui";
changelog = "https://github.com/canonical/lxd-ui/releases/tag/${version}";
license = lib.licenses.gpl3;
maintainers = [ ];
platforms = lib.platforms.linux;
};
}