summary refs log tree commit diff
path: root/nixos/modules/hardware
diff options
context:
space:
mode:
authorK900 <me@0upti.me>2022-08-19 19:57:13 +0300
committerK900 <me@0upti.me>2022-08-19 20:17:28 +0300
commit907b497d7e7669f3c2794ab313f8c42f80929bd6 (patch)
treec507026156e2fb41879343e2f8402ef6f7420648 /nixos/modules/hardware
parent846d001fb81e19703e826ee0820ee0a6b183ff7a (diff)
downloadnixpkgs-907b497d7e7669f3c2794ab313f8c42f80929bd6.tar
nixpkgs-907b497d7e7669f3c2794ab313f8c42f80929bd6.tar.gz
nixpkgs-907b497d7e7669f3c2794ab313f8c42f80929bd6.tar.bz2
nixpkgs-907b497d7e7669f3c2794ab313f8c42f80929bd6.tar.lz
nixpkgs-907b497d7e7669f3c2794ab313f8c42f80929bd6.tar.xz
nixpkgs-907b497d7e7669f3c2794ab313f8c42f80929bd6.tar.zst
nixpkgs-907b497d7e7669f3c2794ab313f8c42f80929bd6.zip
nixos/hardware/device-tree: use symbols from the exact kernel package
Diffstat (limited to 'nixos/modules/hardware')
-rw-r--r--nixos/modules/hardware/device-tree.nix23
1 files changed, 4 insertions, 19 deletions
diff --git a/nixos/modules/hardware/device-tree.nix b/nixos/modules/hardware/device-tree.nix
index 55852776220..4ce3a3e6c6a 100644
--- a/nixos/modules/hardware/device-tree.nix
+++ b/nixos/modules/hardware/device-tree.nix
@@ -56,23 +56,6 @@ let
     };
   };
 
-  # this requires kernel package
-  dtbsWithSymbols = pkgs.stdenv.mkDerivation {
-    name = "dtbs-with-symbols";
-    inherit (cfg.kernelPackage) src nativeBuildInputs depsBuildBuild;
-    patches = map (patch: patch.patch) cfg.kernelPackage.kernelPatches;
-    buildPhase = ''
-      patchShebangs scripts/*
-      substituteInPlace scripts/Makefile.lib \
-        --replace 'DTC_FLAGS += $(DTC_FLAGS_$(basetarget))' 'DTC_FLAGS += $(DTC_FLAGS_$(basetarget)) -@'
-      make ${pkgs.stdenv.hostPlatform.linux-kernel.baseConfig} ARCH="${pkgs.stdenv.hostPlatform.linuxArch}"
-      make dtbs ARCH="${pkgs.stdenv.hostPlatform.linuxArch}"
-    '';
-    installPhase = ''
-      make dtbs_install INSTALL_DTBS_PATH=$out/dtbs  ARCH="${pkgs.stdenv.hostPlatform.linuxArch}"
-    '';
-  };
-
   filterDTBs = src: if isNull cfg.filter
     then "${src}/dtbs"
     else
@@ -83,6 +66,8 @@ let
           | xargs -0 cp -v --no-preserve=mode --target-directory $out --parents
       '';
 
+  filteredDTBs = filterDTBs cfg.kernelPackage;
+
   # Compile single Device Tree overlay source
   # file (.dts) into its compiled variant (.dtbo)
   compileDTS = name: f: pkgs.callPackage({ stdenv, dtc }: stdenv.mkDerivation {
@@ -197,7 +182,7 @@ in
     };
 
     hardware.deviceTree.package = if (cfg.overlays != [])
-      then pkgs.deviceTree.applyOverlays (filterDTBs dtbsWithSymbols) (withDTBOs cfg.overlays)
-      else (filterDTBs cfg.kernelPackage);
+      then pkgs.deviceTree.applyOverlays filteredDTBs (withDTBOs cfg.overlays)
+      else filteredDTBs;
   };
 }