From 245d8f9f97d35a607822ed51bafd7c105c0e819a Mon Sep 17 00:00:00 2001 From: Karolis Stasaitis Date: Mon, 8 Aug 2022 18:27:49 +0200 Subject: [PATCH] apply review suggestions from @06kellyjac Co-authored-by: j-k --- raspberry-pi/4/apply-overlays-dtmerge.nix | 4 +++- raspberry-pi/4/pkgs-overlays.nix | 6 ++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/raspberry-pi/4/apply-overlays-dtmerge.nix b/raspberry-pi/4/apply-overlays-dtmerge.nix index 0d17bb8..8a325ab 100644 --- a/raspberry-pi/4/apply-overlays-dtmerge.nix +++ b/raspberry-pi/4/apply-overlays-dtmerge.nix @@ -1,9 +1,11 @@ +# modification of nixpkgs deviceTree.applyOverlays to resolve https://github.com/NixOS/nixpkgs/issues/125354 +# https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/device-tree/default.nix { lib, pkgs, stdenvNoCC, dtc, libraspberrypi }: with lib; { applyOverlays = (base: overlays': stdenvNoCC.mkDerivation { name = "device-tree-overlays"; - nativeBuildInputs = [ dtc ]; + nativeBuildInputs = [ dtc libraspberrypi ]; buildCommand = let overlays = toList overlays'; in '' diff --git a/raspberry-pi/4/pkgs-overlays.nix b/raspberry-pi/4/pkgs-overlays.nix index 4b3c16d..c290d2a 100644 --- a/raspberry-pi/4/pkgs-overlays.nix +++ b/raspberry-pi/4/pkgs-overlays.nix @@ -1,17 +1,15 @@ { config, lib, pkgs, modulesPath, ... }: let - callPackage = path: overrides: - let f = import path; - in f ((builtins.intersectAttrs (builtins.functionArgs f) pkgs) // overrides); cfg = config.hardware.raspberry-pi."4".apply-overlays-dtmerge; dt_ao_overlay = (final: prev: { - deviceTree.applyOverlays = (prev.callPackage ./apply-overlays-dtmerge.nix { }).applyOverlays; + deviceTree.applyOverlays = (prev.callPackage ./apply-overlays-dtmerge.nix { }) }); in { options.hardware = { raspberry-pi."4".apply-overlays-dtmerge = { enable = lib.mkEnableOption '' replace deviceTree.applyOverlays implementation to use dtmerge from libraspberrypi. + this can resolve issues with applying dtbs for the pi. ''; }; };