Files
nixpkgs/pkgs/by-name/al/alice-lg/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

98 lines
2.1 KiB
Nix

{
lib,
fetchFromGitHub,
buildGoModule,
fetchYarnDeps,
stdenv,
nix-update-script,
yarn,
nodejs,
nixosTests,
fixup-yarn-lock,
}:
buildGoModule rec {
pname = "alice-lg";
version = "6.2.0";
src = fetchFromGitHub {
owner = "alice-lg";
repo = "alice-lg";
tag = version;
hash = "sha256-DlmUurpu/bs/91fLsSQ3xJ8I8NWJweynMgV6Svkf0Uo=";
};
vendorHash = "sha256-OkOUgW6BHJKIdY1soMqTXhL6RYy3567iL1/VZasIdvQ=";
passthru.ui = stdenv.mkDerivation {
pname = "alice-lg-ui";
src = "${src}/ui";
inherit version;
yarnOfflineCache = fetchYarnDeps {
yarnLock = src + "/ui/yarn.lock";
hash = "sha256-PwByNIegKYTOT8Yg3nDMDFZiLRVkbX07z99YaDiBsIY=";
};
nativeBuildInputs = [
nodejs
yarn
fixup-yarn-lock
];
configurePhase = ''
runHook preConfigure
# Yarn and bundler wants a real home directory to write cache, config, etc to
export HOME=$NIX_BUILD_TOP/fake_home
# Make yarn install packages from our offline cache, not the registry
yarn config --offline set yarn-offline-mirror $yarnOfflineCache
# Fixup "resolved"-entries in yarn.lock to match our offline cache
fixup-yarn-lock yarn.lock
yarn install --offline --frozen-lockfile --ignore-scripts --no-progress --non-interactive
patchShebangs node_modules/
runHook postConfigure
'';
buildPhase = ''
runHook preBuild
./node_modules/.bin/react-scripts build
runHook postBuild
'';
installPhase = ''
runHook preInstall
mv build $out
runHook postInstall
'';
};
preBuild = ''
cp -R ${passthru.ui}/ ui/build/
'';
subPackages = [ "cmd/alice-lg" ];
doCheck = false;
passthru = {
tests = nixosTests.alice-lg;
updateScript = nix-update-script { };
};
meta = {
homepage = "https://github.com/alice-lg/alice-lg";
description = "Looking-glass for BGP sessions";
changelog = "https://github.com/alice-lg/alice-lg/blob/main/CHANGELOG.md";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ stv0g ];
mainProgram = "alice-lg";
};
}