about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/system/pciutils/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/system/pciutils/default.nix')
-rw-r--r--nixpkgs/pkgs/tools/system/pciutils/default.nix16
1 files changed, 12 insertions, 4 deletions
diff --git a/nixpkgs/pkgs/tools/system/pciutils/default.nix b/nixpkgs/pkgs/tools/system/pciutils/default.nix
index a89de032abd7..8c017c42d7a3 100644
--- a/nixpkgs/pkgs/tools/system/pciutils/default.nix
+++ b/nixpkgs/pkgs/tools/system/pciutils/default.nix
@@ -1,6 +1,7 @@
 { lib, stdenv, fetchurl, pkg-config, zlib, kmod, which
+, hwdata
 , static ? stdenv.hostPlatform.isStatic
-, darwin ? null
+, IOKit
 }:
 
 stdenv.mkDerivation rec {
@@ -13,7 +14,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkg-config ];
   buildInputs = [ zlib kmod which ] ++
-    lib.optional stdenv.hostPlatform.isDarwin darwin.apple_sdk.frameworks.IOKit;
+    lib.optional stdenv.hostPlatform.isDarwin IOKit;
 
   preConfigure = if stdenv.cc.isGNU then null else ''
     substituteInPlace Makefile --replace 'CC=$(CROSS_COMPILE)gcc' ""
@@ -30,8 +31,15 @@ stdenv.mkDerivation rec {
 
   installTargets = [ "install" "install-lib" ];
 
-  # Get rid of update-pciids as it won't work.
-  postInstall = "rm $out/sbin/update-pciids $out/man/man8/update-pciids.8";
+  postInstall = ''
+    # Remove update-pciids as it won't work on nixos
+    rm $out/sbin/update-pciids $out/man/man8/update-pciids.8
+
+    # use database from hwdata instead
+    # (we don't create a symbolic link because we do not want to pull in the
+    # full closure of hwdata)
+    cp --reflink=auto ${hwdata}/share/hwdata/pci.ids $out/share/pci.ids
+  '';
 
   meta = with lib; {
     homepage = "http://mj.ucw.cz/pciutils.html";