nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 79 lines 1.6 kB view raw
1{ 2 lib, 3 fetchFromGitea, 4 fetchNpmDeps, 5 installShellFiles, 6 pkg-config, 7 rustPlatform, 8 npmHooks, 9 stdenv, 10 nodejs, 11 udev, 12}: 13 14rustPlatform.buildRustPackage rec { 15 pname = "ratman"; 16 version = "0.7.0"; 17 18 src = fetchFromGitea { 19 domain = "codeberg.org"; 20 owner = "irdest"; 21 repo = "irdest"; 22 tag = "${version}"; 23 hash = "sha256-rdKfKbikyqs0Y/y9A8XRVSKenjHD5rS3blxwy98Tvmg="; 24 }; 25 26 cargoHash = "sha256-H1XE+khN6sU9WTM87foEQRTK0u5fgDZvoG3//hvd464="; 27 28 nativeBuildInputs = [ 29 pkg-config 30 installShellFiles 31 ]; 32 33 buildInputs = [ udev ]; 34 35 cargoBuildFlags = [ 36 "-p" 37 "ratmand" 38 "-p" 39 "ratman-tools" 40 ]; 41 cargoTestFlags = cargoBuildFlags; 42 43 dashboard = stdenv.mkDerivation rec { 44 pname = "ratman-dashboard"; 45 inherit version src; 46 sourceRoot = "${src.name}/ratman/dashboard"; 47 48 npmDeps = fetchNpmDeps { 49 name = "${pname}-${version}-npm-deps"; 50 src = "${src}/ratman/dashboard"; 51 hash = "sha256-47L4V/Vf8DK3q63MYw3x22+rzIN3UPD0N/REmXh5h3w="; 52 }; 53 54 nativeBuildInputs = [ 55 nodejs 56 npmHooks.npmConfigHook 57 npmHooks.npmBuildHook 58 ]; 59 60 npmBuildScript = "build"; 61 62 installPhase = '' 63 mkdir $out 64 cp -r dist/* $out/ 65 ''; 66 }; 67 68 prePatch = '' 69 cp -r ${dashboard} ratman/dashboard/dist 70 ''; 71 72 meta = with lib; { 73 description = "Modular decentralised peer-to-peer packet router and associated tools"; 74 homepage = "https://git.irde.st/we/irdest"; 75 platforms = platforms.unix; 76 license = licenses.agpl3Only; 77 maintainers = with maintainers; [ spacekookie ]; 78 }; 79}