about summary refs log tree commit diff
path: root/pkgs/by-name/fa/facter/package.nix
blob: fa92def6b1bc280b35792aa9da5ef69ef7721d10 (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
59
60
61
62
63
64
65
66
{
  bundlerApp,
  bundlerUpdateScript,
  coreutils,
  facter,
  gnugrep,
  iproute2,
  lib,
  makeWrapper,
  nettools,
  pciutils,
  procps,
  stdenv,
  testers,
  util-linux,
  virt-what,
  zfs,
}:

bundlerApp {
  pname = "facter";
  gemdir = ./.;
  exes = [ "facter" ];

  nativeBuildInputs = [ makeWrapper ];

  postBuild =
    let
      runtimeDependencies =
        [
          coreutils
          gnugrep
          nettools
          pciutils
          procps
          util-linux
        ]
        ++ lib.optionals stdenv.isLinux [
          iproute2
          virt-what
          zfs
        ];
    in
    ''
      wrapProgram $out/bin/facter --prefix PATH : ${lib.makeBinPath runtimeDependencies}
    '';

  passthru = {
    tests.version = testers.testVersion {
      command = "${lib.getExe facter} --version";
      package = facter;
      version = (import ./gemset.nix).facter.version;
    };
    updateScript = bundlerUpdateScript "facter";
  };

  meta = {
    changelog = "https://www.puppet.com/docs/puppet/latest/release_notes_facter.html";
    description = "System inventory tool";
    homepage = "https://github.com/puppetlabs/facter";
    license = lib.licenses.asl20;
    mainProgram = "facter";
    maintainers = with lib.maintainers; [ womfoo anthonyroussel ];
    platforms = lib.platforms.unix;
  };
}