about summary refs log tree commit diff
path: root/pkgs/applications/system/booster/default.nix
blob: dda41f24531b138d7cfa443fb925a84c04ce207b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{ bash
, binutils
, buildGoModule
, fetchFromGitHub
, kbd
, lib
, libfido2
, lvm2
, lz4
, makeWrapper
, mdadm
, unixtools
, xz
, zfs
}:

buildGoModule rec {
  pname = "booster";
  version = "0.9";

  src = fetchFromGitHub {
    owner = "anatol";
    repo = pname;
    rev = version;
    hash = "sha256-kalVFVBb+ngoUpm+iiIHGS6vBVLEvTVyKuSMSMbp7Qc=";
  };

  vendorHash = "sha256-GD+nsT4/Y2mTF+ztOC3N560BY5+QSfsPrXZ+dJYtzAw=";

  postPatch = ''
    substituteInPlace init/main.go --replace "/usr/bin/fsck" "${unixtools.fsck}/bin/fsck"
  '';

  # integration tests are run against the current kernel
  doCheck = false;

  nativeBuildInputs = [
    kbd
    lz4
    makeWrapper
    xz
  ];

  postInstall = let
    runtimeInputs = [ bash binutils kbd libfido2 lvm2 mdadm zfs ];
  in ''
    wrapProgram $out/bin/generator --prefix PATH : ${lib.makeBinPath runtimeInputs}
    wrapProgram $out/bin/init --prefix PATH : ${lib.makeBinPath runtimeInputs}
  '';

  meta = with lib; {
    description = "Fast and secure initramfs generator ";
    homepage = "https://github.com/anatol/booster";
    license = licenses.mit;
    maintainers = with maintainers; [ urandom ];
    mainProgram = "init";
  };
}