diff options
author | Florian Klink <flokli@flokli.de> | 2022-06-19 11:13:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-19 11:13:54 +0200 |
commit | 4386cb104ef73c958bd9547970965ba5578e482e (patch) | |
tree | 5546efb7e90b567131ee0d4e94956bfcb11fc174 /nixos/modules/hardware | |
parent | 0d68d7c857fe301d49cdcd56130e0beea4ecd5aa (diff) | |
parent | 754005bf485d31384e1905a9af1ad2293a64be20 (diff) |
Merge pull request #178200 from lopsided98/device-tree-preprocessor
nixos/device-tree: preprocess overlays before compiling
Diffstat (limited to 'nixos/modules/hardware')
-rw-r--r-- | nixos/modules/hardware/device-tree.nix | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/nixos/modules/hardware/device-tree.nix b/nixos/modules/hardware/device-tree.nix index be67116ad507d..5a8a8e27bee1b 100644 --- a/nixos/modules/hardware/device-tree.nix +++ b/nixos/modules/hardware/device-tree.nix @@ -36,14 +36,11 @@ let /plugin/; / { compatible = "raspberrypi"; - fragment@0 { - target-path = "/soc"; - __overlay__ { - pps { - compatible = "pps-gpio"; - status = "okay"; - }; - }; + }; + &{/soc} { + pps { + compatible = "pps-gpio"; + status = "okay"; }; }; ''; @@ -88,13 +85,14 @@ let # Compile single Device Tree overlay source # file (.dts) into its compiled variant (.dtbo) - compileDTS = name: f: pkgs.callPackage({ dtc }: pkgs.stdenv.mkDerivation { + compileDTS = name: f: pkgs.callPackage({ stdenv, dtc }: stdenv.mkDerivation { name = "${name}-dtbo"; nativeBuildInputs = [ dtc ]; buildCommand = '' - dtc -I dts ${f} -O dtb -@ -o $out + $CC -E -nostdinc -I${getDev cfg.kernelPackage}/lib/modules/${cfg.kernelPackage.modDirVersion}/source/scripts/dtc/include-prefixes -undef -D__DTS__ -x assembler-with-cpp ${f} | \ + dtc -I dts -O dtb -@ -o $out ''; }) {}; |