diff options
author | Yureka <yuka@yuka.dev> | 2024-03-20 10:18:13 +0100 |
---|---|---|
committer | github-actions[bot] <github-actions[bot]@users.noreply.github.com> | 2024-04-09 23:57:48 +0000 |
commit | 4c71865b51e70191b5f990857aba7b470b32ff72 (patch) | |
tree | 47d4f0c085ccf7e8a27d17f5853402ee422e06fc /pkgs/by-name | |
parent | 1b2b853cd74e22399de39f9ddb5b77773238c7d3 (diff) |
fernglas: init at 0.2.1
(cherry picked from commit a9a37884b41e989c8f125c4588f306e677cb8e33)
Diffstat (limited to 'pkgs/by-name')
-rw-r--r-- | pkgs/by-name/fe/fernglas/package.nix | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/pkgs/by-name/fe/fernglas/package.nix b/pkgs/by-name/fe/fernglas/package.nix new file mode 100644 index 0000000000000..3de9736128572 --- /dev/null +++ b/pkgs/by-name/fe/fernglas/package.nix @@ -0,0 +1,72 @@ +{ lib +, stdenv +, rustPlatform +, fetchFromGitHub +, fetchYarnDeps +, prefetch-yarn-deps +, python3 +, jq +, yarn +, nodejs-slim +}: + +rustPlatform.buildRustPackage rec { + pname = "fernglas"; + version = "0.2.1"; + + src = fetchFromGitHub { + owner = "wobcom"; + repo = "fernglas"; + rev = "fernglas-${version}"; + hash = "sha256-0wj5AS8RLVr+S/QWWxCsMvmVjmXUWGfR9kPaZimJEss="; + }; + + nativeBuildInputs = [ yarn nodejs-slim prefetch-yarn-deps python3 jq ]; + + nlnog_communities = fetchFromGitHub { + owner = "NLNOG"; + repo = "lg.ring.nlnog.net"; + rev = "20f9a9f3da8b1bc9d7046e88c62df4b41b4efb99"; + hash = "sha256-FlbOBX/+/LLmoqMJLvu59XuHYmiohIhDc1VjkZu4Wzo="; + }; + + cargoHash = "sha256-ls9HvwtbpOwzQbi/+9IbgXurZp0LjQKGZcDuLZlX+Vk="; + + offlineCache = fetchYarnDeps { + yarnLock = src + "/frontend/yarn.lock"; + hash = "sha256-/ubCAs4C5nG8xNC77jTH+cJVNgddSxqGGPEVLDH/Cdo="; + }; + + cargoBuildFlags = lib.optionals (stdenv.hostPlatform.isMusl && stdenv.hostPlatform.isStatic) [ + "--features" "mimalloc" + ] ++ [ + "--features" "embed-static" + ]; + + preBuild = '' + python3 contrib/print_communities.py $nlnog_communities/communities | jq . > src/communities.json + + pushd frontend + + export HOME=$TMPDIR + yarn config --offline set yarn-offline-mirror $offlineCache + fixup-yarn-lock yarn.lock + yarn install --offline --frozen-lockfile --ignore-scripts --no-progress --non-interactive + patchShebangs node_modules/ + + FERNGLAS_VERSION=${version} FERNGLAS_COMMIT=${src.rev} node_modules/.bin/webpack + cp -r dist/ ../static + + popd + ''; + + meta = with lib; { + description = "Looking glass for your network using BGP and BMP as data source"; + homepage = "https://wobcom.github.io/fernglas/"; + changelog = "https://github.com/wobcom/fernglas/releases/tag/fernglas-${version}"; + license = licenses.eupl12; + platforms = platforms.linux; + maintainers = teams.wdz.members; + mainProgram = "fernglas"; + }; +} |