8 pname = "nitrokey-storage-firmware";
11 src = fetchFromGitHub {
13 repo = "nitrokey-storage-firmware";
15 hash = "sha256-u8IK57NVS/IOPIE3Ah/O8WuOIr0EY6AF1bEaeDgIBuk=";
18 toolchain = stdenv.mkDerivation (finalAttrs: {
19 pname = "avr32-toolchain";
20 version = "3.0.0.201009140852";
23 url = "https://ww1.microchip.com/downloads/archive/avr32studio-ide-2.6.0.753-linux.gtk.x86_64.zip";
24 hash = "sha256-MwsaGyNqbO0lBy1rcczuvKOaGbO3f0V+j84sUCkRlxc=";
28 cp ${src}/pm_240.h plugins/com.atmel.avr.toolchains.linux.x86_64_${finalAttrs.version}/os/linux/x86_64/avr32/include/avr32/pm_231.h
33 cp -r plugins/com.atmel.avr.toolchains.linux.x86_64_${finalAttrs.version}/os/linux/x86_64 $out
34 rm -r $out/avr $out/bin/avr-*
39 description = "AVR32 toolchain";
40 homepage = "https://web.archive.org/web/20210419192039/https://www.microchip.com/mplab/avr-support/avr-and-sam-downloads-archive";
41 # The zip does not explicitly say this,
42 # it only mentions the license(s) of AVR32 Studio.
43 # Because it is very clearly a fork of GCC 4.3.3,
44 # it should be licensed under GPLv2+
45 license = lib.licenses.gpl2Plus;
46 platforms = [ "x86_64-linux" ];
51 inherit pname version src;
53 sourceRoot = "source/src";
56 substituteInPlace Makefile \
57 --replace-fail '$(shell git describe)' "V${version}"
61 "CC=${toolchain}/bin/avr32-gcc"
62 "nitrokey-storage-V${version}-reproducible.hex"
65 enableParallelBuilding = true;
69 install -D nitrokey-storage-V${version}-reproducible.hex $out/nitrokey-storage-V${version}-reproducible.hex
74 description = "Firmware for the Nitrokey Storage device";
75 homepage = "https://github.com/Nitrokey/nitrokey-storage-firmware";
76 license = lib.licenses.gpl3Plus;
77 maintainers = with lib.maintainers; [
82 platforms = [ "x86_64-linux" ];