Merge pull request #297416 from yu-re-ka/fernglas

fernglas: init at 0.2.1

authored by kirillrdy and committed by GitHub 58caac99 f3c42fbc

+72
+72
pkgs/by-name/fe/fernglas/package.nix
···
··· 1 + { lib 2 + , stdenv 3 + , rustPlatform 4 + , fetchFromGitHub 5 + , fetchYarnDeps 6 + , prefetch-yarn-deps 7 + , python3 8 + , jq 9 + , yarn 10 + , nodejs-slim 11 + }: 12 + 13 + rustPlatform.buildRustPackage rec { 14 + pname = "fernglas"; 15 + version = "0.2.1"; 16 + 17 + src = fetchFromGitHub { 18 + owner = "wobcom"; 19 + repo = "fernglas"; 20 + rev = "fernglas-${version}"; 21 + hash = "sha256-0wj5AS8RLVr+S/QWWxCsMvmVjmXUWGfR9kPaZimJEss="; 22 + }; 23 + 24 + nativeBuildInputs = [ yarn nodejs-slim prefetch-yarn-deps python3 jq ]; 25 + 26 + nlnog_communities = fetchFromGitHub { 27 + owner = "NLNOG"; 28 + repo = "lg.ring.nlnog.net"; 29 + rev = "20f9a9f3da8b1bc9d7046e88c62df4b41b4efb99"; 30 + hash = "sha256-FlbOBX/+/LLmoqMJLvu59XuHYmiohIhDc1VjkZu4Wzo="; 31 + }; 32 + 33 + cargoHash = "sha256-ls9HvwtbpOwzQbi/+9IbgXurZp0LjQKGZcDuLZlX+Vk="; 34 + 35 + offlineCache = fetchYarnDeps { 36 + yarnLock = src + "/frontend/yarn.lock"; 37 + hash = "sha256-/ubCAs4C5nG8xNC77jTH+cJVNgddSxqGGPEVLDH/Cdo="; 38 + }; 39 + 40 + cargoBuildFlags = lib.optionals (stdenv.hostPlatform.isMusl && stdenv.hostPlatform.isStatic) [ 41 + "--features" "mimalloc" 42 + ] ++ [ 43 + "--features" "embed-static" 44 + ]; 45 + 46 + preBuild = '' 47 + python3 contrib/print_communities.py $nlnog_communities/communities | jq . > src/communities.json 48 + 49 + pushd frontend 50 + 51 + export HOME=$TMPDIR 52 + yarn config --offline set yarn-offline-mirror $offlineCache 53 + fixup-yarn-lock yarn.lock 54 + yarn install --offline --frozen-lockfile --ignore-scripts --no-progress --non-interactive 55 + patchShebangs node_modules/ 56 + 57 + FERNGLAS_VERSION=${version} FERNGLAS_COMMIT=${src.rev} node_modules/.bin/webpack 58 + cp -r dist/ ../static 59 + 60 + popd 61 + ''; 62 + 63 + meta = with lib; { 64 + description = "Looking glass for your network using BGP and BMP as data source"; 65 + homepage = "https://wobcom.github.io/fernglas/"; 66 + changelog = "https://github.com/wobcom/fernglas/releases/tag/fernglas-${version}"; 67 + license = licenses.eupl12; 68 + platforms = platforms.linux; 69 + maintainers = teams.wdz.members; 70 + mainProgram = "fernglas"; 71 + }; 72 + }