summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/mo/modprobed-db/package.nix
blob: 1eafb4405fd21304a04f8946e281174ec35fc99c (plain)
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
{
  lib,
  stdenv,
  fetchFromGitHub,
  pkg-config,
  libevdev,
  kmod,
  bash,
  installShellFiles,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "modprobed-db";
  version = "2.51";

  src = fetchFromGitHub {
    owner = "graysky2";
    repo = "modprobed-db";
    rev = "v${finalAttrs.version}";
    hash = "sha256-C73qDaY+I0bypaZqEipAuj4CAX1wIWhIMOzYpRiaGPE=";
  };

  strictDeps = true;
  nativeBuildInputs = [
    pkg-config
    installShellFiles
  ];
  buildInputs = [
    kmod
    libevdev
    bash
  ];

  installFlags = [
    "PREFIX=$(out)"
    "INITDIR_SYSTEMD=$(out)/lib/systemd/user"
  ];

  postPatch = ''
    substituteInPlace ./common/modprobed-db.in \
      --replace "/usr/share" "$out/share"
  '';

  postInstall = ''
    installShellCompletion --zsh common/zsh-completion
  '';

  meta = {
    homepage = "https://github.com/graysky2/modprobed-db";
    description = "Useful utility for users wishing to build a minimal kernel via a make localmodconfig";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ NotAShelf ];
    mainProgram = "modprobed-db";
    platforms = lib.platforms.linux;
  };
})