depot/pkgs/by-name/el/elf2nucleus/package.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

41 lines
1.1 KiB
Nix

{
installShellFiles
, fetchFromGitHub
, lib
, micronucleus
, rustPlatform
, stdenv
}:
rustPlatform.buildRustPackage rec {
pname = "elf2nucleus";
version = "0.1.0";
src = fetchFromGitHub {
owner = "kpcyrd";
repo = pname;
rev = "v${version}";
hash = "sha256-FAIOtGfGow+0DrPPEBEfvaiinNZLQlGWKJ4DkMj63OA=";
};
cargoHash = "sha256-IeQnI6WTzxSI/VzoHtVukZtB1jX98wzLOT01NMLD5wQ=";
nativeBuildInputs = [ installShellFiles ];
buildInputs = [ micronucleus ];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd elf2nucleus \
--bash <($out/bin/elf2nucleus --completions bash) \
--fish <($out/bin/elf2nucleus --completions fish) \
--zsh <($out/bin/elf2nucleus --completions zsh)
'';
meta = with lib; {
description = "Integrate micronucleus into the cargo buildsystem, flash an AVR firmware from an elf file";
mainProgram = "elf2nucleus";
homepage = "https://github.com/kpcyrd/elf2nucleus";
license = licenses.gpl3Plus;
maintainers = [ maintainers.marble ];
};
}