From 67c19cf1f7b1b3ead6ec4bced856fac9514421eb Mon Sep 17 00:00:00 2001 From: Enric Morales Date: Wed, 28 Aug 2024 15:29:52 +0000 Subject: [PATCH] nitrokey-start-firmware: init at 13 Co-authored-by: Simon Bruder Co-authored-by: Abdullah Imad Co-authored-by: Alberto Merino Co-authored-by: Enric Morales Co-authored-by: Jack Leightcap Co-authored-by: Roland Coeurjoly --- .../ni/nitrokey-start-firmware/package.nix | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 pkgs/by-name/ni/nitrokey-start-firmware/package.nix diff --git a/pkgs/by-name/ni/nitrokey-start-firmware/package.nix b/pkgs/by-name/ni/nitrokey-start-firmware/package.nix new file mode 100644 index 000000000000..f4b20b56ea71 --- /dev/null +++ b/pkgs/by-name/ni/nitrokey-start-firmware/package.nix @@ -0,0 +1,59 @@ +{ + lib, + stdenv, + fetchFromGitHub, + gcc-arm-embedded, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "nitrokey-start-firmware"; + version = "13"; + + src = fetchFromGitHub { + owner = "Nitrokey"; + repo = "nitrokey-start-firmware"; + rev = "RTM.${finalAttrs.version}"; + hash = "sha256-POW1d/fgOyYa7127FSTCtHGyMWYzKW0qqA1WUyvNc3w="; + fetchSubmodules = true; + }; + + sourceRoot = "source/src"; + + postPatch = '' + patchShebangs configure + ''; + + # Avoid additional arguments are added to configureFlags + configurePlatforms = [ ]; + + # from release/Makefile + configureFlags = [ + "--target=NITROKEY_START-g" + "--vidpid=20a0:4211" + "--enable-factory-reset" + "--enable-certdo" + ]; + + nativeBuildInputs = [ gcc-arm-embedded ]; + + enableParallelBuilding = true; + + installPhase = '' + runHook preInstall + mkdir $out + cp build/gnuk.{bin,hex} $out/ + runHook postInstall + ''; + + meta = { + description = "Firmware for the Nitrokey Start device"; + homepage = "https://github.com/Nitrokey/nitrokey-start-firmware"; + license = lib.licenses.gpl3Plus; + maintainers = with lib.maintainers; [ + amerino + imadnyc + kiike + ]; + platforms = lib.platforms.unix; + }; +})