1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 nasm,
6 unixtools,
7}:
8
9let
10 version = "10";
11in
12
13stdenv.mkDerivation {
14 pname = "gordonflashtool";
15 inherit version;
16
17 src = fetchFromGitHub {
18 owner = "marmolak";
19 repo = "GordonFlashTool";
20 rev = "release-${version}";
21 hash = "sha256-/zpw7kVdQeR7QcRsP1+qcu8+hlEQTGwOKClJkwVcBPg=";
22 };
23
24 nativeBuildInputs = [
25 nasm
26 unixtools.xxd
27 ];
28
29 buildPhase = ''
30 runHook preBuild
31 # build the gordon binary
32 make all-boot-code
33 runHook postBuild
34 '';
35
36 installPhase = ''
37 runHook preInstall
38 install -Dm755 gordon $out/bin/gordon
39 runHook postInstall
40 '';
41
42 meta = {
43 homepage = "https://github.com/marmolak/GordonFlashTool";
44 description = "Toolset for Gotek SFR1M44-U100 formatted usb flash drives";
45 maintainers = with lib.maintainers; [ marmolak ];
46 license = lib.licenses.bsd3;
47 platforms = lib.platforms.all;
48 mainProgram = "gordon";
49 };
50}