base16-schemes: unstable-2024-06-21 -> unstable-2024-11-12
[NixPkgs.git] / pkgs / by-name / ni / nixos-facter / package.nix
blobc9d2f1d5171e549fe378ba6f2034143774748ac0
2   lib,
3   buildGoModule,
4   fetchFromGitHub,
5   hwinfo,
6   libusb1,
7   gcc,
8   pkg-config,
9   util-linux,
10   pciutils,
11   stdenv,
12   systemdMinimal,
14 let
15   # We are waiting on some changes to be merged upstream: https://github.com/openSUSE/hwinfo/pulls
16   hwinfoOverride = hwinfo.overrideAttrs {
17     src = fetchFromGitHub {
18       owner = "numtide";
19       repo = "hwinfo";
20       rev = "c2259845d10694c099fb306a8cfc5a403e71c708";
21       hash = "sha256-RGIoJkYiNMRHwUclzdRMELxCgBU9Pfvaghvt3op0zM0=";
22     };
23   };
25 buildGoModule rec {
26   pname = "nixos-facter";
27   version = "0.2.0";
29   src = fetchFromGitHub {
30     owner = "numtide";
31     repo = "nixos-facter";
32     rev = "v${version}";
33     hash = "sha256-Rird32KB+V1xGBZvrEaPDPOhl5YMClIljOLcFO/0vOU=";
34   };
36   vendorHash = "sha256-qDzd+aq08PN9kl1YkvNLGvWaFVh7xFXJhGdx/ELwYGY=";
38   CGO_ENABLED = 1;
40   buildInputs = [
41     libusb1
42     hwinfoOverride
43   ];
45   nativeBuildInputs = [
46     gcc
47     pkg-config
48   ];
50   runtimeInputs = [
51     libusb1
52     util-linux
53     pciutils
54     systemdMinimal
55   ];
57   ldflags = [
58     "-s"
59     "-w"
60     "-X git.numtide.com/numtide/nixos-facter/build.Name=nixos-facter"
61     "-X git.numtide.com/numtide/nixos-facter/build.Version=v${version}"
62     "-X github.com/numtide/nixos-facter/pkg/build.System=${stdenv.hostPlatform.system}"
63   ];
65   meta = {
66     description = "Declarative hardware configuration for NixOS";
67     homepage = "https://github.com/numtide/nixos-facter";
68     license = lib.licenses.gpl3Plus;
69     maintainers = [ lib.maintainers.brianmcgee ];
70     mainProgram = "nixos-facter";
71     platforms = lib.platforms.linux;
72   };