nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 41 lines 1.1 kB view raw
1{ 2 installShellFiles, 3 fetchFromGitHub, 4 lib, 5 micronucleus, 6 rustPlatform, 7 stdenv, 8}: 9 10rustPlatform.buildRustPackage rec { 11 pname = "elf2nucleus"; 12 version = "0.1.0"; 13 14 src = fetchFromGitHub { 15 owner = "kpcyrd"; 16 repo = "elf2nucleus"; 17 rev = "v${version}"; 18 hash = "sha256-FAIOtGfGow+0DrPPEBEfvaiinNZLQlGWKJ4DkMj63OA="; 19 }; 20 21 cargoHash = "sha256-Xw+heCEwQePyU2gElpG8PTIUZA7y+Onx+2AX2NZzDGs="; 22 23 nativeBuildInputs = [ installShellFiles ]; 24 25 buildInputs = [ micronucleus ]; 26 27 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' 28 installShellCompletion --cmd elf2nucleus \ 29 --bash <($out/bin/elf2nucleus --completions bash) \ 30 --fish <($out/bin/elf2nucleus --completions fish) \ 31 --zsh <($out/bin/elf2nucleus --completions zsh) 32 ''; 33 34 meta = with lib; { 35 description = "Integrate micronucleus into the cargo buildsystem, flash an AVR firmware from an elf file"; 36 mainProgram = "elf2nucleus"; 37 homepage = "https://github.com/kpcyrd/elf2nucleus"; 38 license = licenses.gpl3Plus; 39 maintainers = [ maintainers.marble ]; 40 }; 41}