mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-23 14:13:35 +00:00
75 lines
1.5 KiB
Nix
75 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.14";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "canonical";
|
|
repo = "lxd-ui";
|
|
rev = "refs/tags/${version}";
|
|
hash = "sha256-mrJpoD8eq/LxZl0JJ0ZqnAvMqqNGqRfi9UUh40PD0TY=";
|
|
};
|
|
|
|
offlineCache = fetchYarnDeps {
|
|
yarnLock = "${src}/yarn.lock";
|
|
hash = "sha256-dkATFNjAPhrPbXhcJ/R4eIpcagKEwBSnRfLwqTPIe6c=";
|
|
};
|
|
|
|
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 = [ ];
|
|
platforms = lib.platforms.linux;
|
|
};
|
|
}
|