Files
nixpkgs/pkgs/by-name/lm/lm4flash/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

60 lines
1.3 KiB
Nix

{
fetchFromGitHub,
stdenv,
libusb1,
pkg-config,
lib,
writeText,
}:
let
stellaris-udev-rules = writeText "61.stellpad.rules" ''
SUBSYSTEM=="usb", ATTRS{idVendor}=="1cbe", ATTRS{idProduct}=="00fd", MODE="0666"
'';
in
stdenv.mkDerivation rec {
pname = "lm4flash";
version = "0.1.3";
src = fetchFromGitHub {
owner = "utzig";
repo = "lm4tools";
tag = "v${version}";
hash = "sha256-ZjuCH/XjQEgg6KHAvb95/BkAy+C2OdbtBb/i6K30+uo=";
};
sourceRoot = "${src.name}/lm4flash";
strictDeps = true;
nativeBuildInputs = [
pkg-config
];
buildInputs = [
libusb1
];
buildFlags = [ "release" ];
installFlags = [ "PREFIX=$(out)" ];
doInstallCheck = true;
postInstall = ''
install -Dm644 "${stellaris-udev-rules}" "$out/etc/udev/rules.d/61.stellpad.rules"
'';
meta = {
description = "Command-line firmware flashing tool for the Stellaris Launchpad";
longDescription = ''
Command-line firmware flashing tool using libusb-1.0 to communicate with
the Stellaris Launchpad ICDI. Works on all Linux, Mac OS X, Windows, and
BSD systems.
'';
homepage = "https://github.com/utzig/lm4tools";
license = lib.licenses.gpl2Plus;
mainProgram = "lm4flash";
maintainers = with lib.maintainers; [ MostafaKhaled ];
platforms = lib.platforms.all;
};
}