depot/third_party/nixpkgs/pkgs/by-name/lx/lxd-ui/package.nix
Default email f34ce41345 Project import generated by Copybara.
GitOrigin-RevId: b73c2221a46c13557b1b3be9c2070cc42cf01eb3
2024-07-27 08:49:29 +02:00

74 lines
1.5 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
fetchYarnDeps,
nodejs,
fixup-yarn-lock,
yarn,
nixosTests,
nix-update-script,
}:
stdenv.mkDerivation rec {
pname = "lxd-ui";
version = "0.12";
src = fetchFromGitHub {
owner = "canonical";
repo = "lxd-ui";
rev = "refs/tags/${version}";
hash = "sha256-dVTUme+23HaONcvfcgen/y1S0D91oYmgGLGfRcAMJSw=";
};
offlineCache = fetchYarnDeps {
yarnLock = "${src}/yarn.lock";
hash = "sha256-lPBkGKK6C6C217wqvOoC7on/Dzmk3NkdIkMDMF9CRNQ=";
};
nativeBuildInputs = [
nodejs
fixup-yarn-lock
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 = ''
runHook preBuild
yarn --offline build
runHook postBuild
'';
installPhase = ''
runHook preInstall
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";
homepage = "https://github.com/canonical/lxd-ui";
changelog = "https://github.com/canonical/lxd-ui/releases/tag/${version}";
license = lib.licenses.gpl3;
maintainers = lib.teams.lxc.members;
platforms = lib.platforms.linux;
};
}