summary refs log tree commit diff
path: root/pkgs/os-specific/linux/beefi/default.nix
blob: 959a43faea91db9e1d0b507d9e3b71c233d7a721 (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
{ stdenv
, lib
, fetchFromGitHub
, installShellFiles
, binutils-unwrapped
, systemd }:

stdenv.mkDerivation rec {
  pname = "beefi";
  version = "0.1.1";

  src = fetchFromGitHub {
    owner = "jfeick";
    repo = "beefi";
    rev = version;
    sha256 = "1180avalbw414q1gnfqdgc9zg3k9y0401kw9qvcn51qph81d04v5";
  };

  nativeBuildInputs = [ installShellFiles ];

  buildInputs = [
    binutils-unwrapped
    systemd
  ];

  patchPhase = ''
    substituteInPlace beefi \
      --replace objcopy ${binutils-unwrapped}/bin/objcopy \
      --replace /usr/lib/systemd ${systemd}/lib/systemd
  '';

  installPhase = ''
    install -Dm755 beefi $out/bin/beefi
    installManPage beefi.1
  '';

  meta = with lib; {
    description = "A small script to create bootable EFISTUB kernel images";
    license = licenses.gpl3;
    platforms = platforms.linux;
    maintainers = with maintainers; [ tu-maurice ];
    homepage = "https://github.com/jfeick/beefi";
  };
}