17 , curl # Preferred to using the Perl HTTP libs - according to hw-probe.
31 # Conditionally recommended
32 , systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd
36 , withRecommended ? true # Install recommended tools
54 , withSuggested ? false # Install (most) suggested tools
57 # , pnputils # pnputils (lspnp) isn't currently in nixpkgs and appears to be poorly maintained
60 stdenv.mkDerivation rec {
64 src = fetchFromGitHub {
68 sha256 = "sha256-WlLSgjVLqGGtwCyyUn9X3XbE2Yhz6LD245+U2JgGd+k=";
71 makeFlags = [ "prefix=$(out)" ];
73 nativeBuildInputs = [ makeWrapper ];
75 buildInputs = [ perl ];
94 recommendedPrograms = [
102 util-linuxMinimal # (rfkill)
104 libva-utils # (vainfo)
110 # cpuid is only compatible with i686 and x86_64
111 ++ lib.optional (lib.elem stdenv.hostPlatform.system cpuid.meta.platforms) cpuid;
112 conditionallyRecommendedPrograms = lib.optional systemdSupport systemd; # (systemd-analyze)
113 suggestedPrograms = [
115 sane-backends # (sane-find-scanner)
120 ++ conditionallyRecommendedPrograms
121 ++ lib.optionals withRecommended recommendedPrograms
122 ++ lib.optionals withSuggested suggestedPrograms;
124 "--set" "PERL5LIB" "${makePerlPath [ LWP LWPProtocolHttps HTTPMessage URI HTTPDate TryTiny ]}"
125 "--prefix" "PATH" ":" "${lib.makeBinPath programs}"
129 wrapProgram $out/bin/hw-probe \
134 description = "Probe for hardware, check operability and find drivers";
135 homepage = "https://github.com/linuxhw/hw-probe";
136 platforms = with platforms; (linux ++ freebsd ++ netbsd ++ openbsd);
137 license = with licenses; [ lgpl21 bsdOriginal ];
138 maintainers = with maintainers; [ rehno-lindeque ];
139 mainProgram = "hw-probe";