nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 45 lines 1.1 kB view raw
1{ 2 lib, 3 fetchFromGitHub, 4 rustPlatform, 5 versionCheckHook, 6}: 7 8rustPlatform.buildRustPackage rec { 9 pname = "nbtscanner"; 10 version = "0.0.2"; 11 12 src = fetchFromGitHub { 13 owner = "jonkgrimes"; 14 repo = "nbtscanner"; 15 tag = version; 16 hash = "sha256-lnTTutOc829COwfNhBkSK8UpiNnGsm7Da53b+eSBt1Q="; 17 }; 18 19 cargoHash = "sha256-/gVJJegPIUe0Mv7+0tCP/vWrMbImtY3tb+lELnn1ur0="; 20 21 cargoPatches = [ 22 ./Cargo.lock.patch 23 ]; 24 25 postPatch = '' 26 # https://github.com/jonkgrimes/nbtscanner/issues/4 27 substituteInPlace src/main.rs \ 28 --replace-fail '.version("0.1")' '.version("${version}")' 29 ''; 30 31 nativeInstallCheckInputs = [ versionCheckHook ]; 32 33 doInstallCheck = true; 34 35 versionCheckProgramArg = "--version"; 36 37 meta = { 38 description = "NetBIOS scanner written in Rust"; 39 homepage = "https://github.com/jonkgrimes/nbtscanner"; 40 changelog = "https://github.com/jonkgrimes/nbtscanner/releases/tag/${version}"; 41 license = lib.licenses.mit; 42 maintainers = with lib.maintainers; [ fab ]; 43 mainProgram = "nbtscanner"; 44 }; 45}