apply review suggestions from @06kellyjac
Co-authored-by: j-k <dev@j-k.io>
This commit is contained in:
parent
128dad1c8d
commit
245d8f9f97
|
@ -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 }:
|
{ lib, pkgs, stdenvNoCC, dtc, libraspberrypi }:
|
||||||
|
|
||||||
with lib; {
|
with lib; {
|
||||||
applyOverlays = (base: overlays': stdenvNoCC.mkDerivation {
|
applyOverlays = (base: overlays': stdenvNoCC.mkDerivation {
|
||||||
name = "device-tree-overlays";
|
name = "device-tree-overlays";
|
||||||
nativeBuildInputs = [ dtc ];
|
nativeBuildInputs = [ dtc libraspberrypi ];
|
||||||
buildCommand = let
|
buildCommand = let
|
||||||
overlays = toList overlays';
|
overlays = toList overlays';
|
||||||
in ''
|
in ''
|
||||||
|
|
|
@ -1,17 +1,15 @@
|
||||||
{ config, lib, pkgs, modulesPath, ... }:
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
let
|
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;
|
cfg = config.hardware.raspberry-pi."4".apply-overlays-dtmerge;
|
||||||
dt_ao_overlay = (final: prev: {
|
dt_ao_overlay = (final: prev: {
|
||||||
deviceTree.applyOverlays = (prev.callPackage ./apply-overlays-dtmerge.nix { }).applyOverlays;
|
deviceTree.applyOverlays = (prev.callPackage ./apply-overlays-dtmerge.nix { })
|
||||||
});
|
});
|
||||||
in {
|
in {
|
||||||
options.hardware = {
|
options.hardware = {
|
||||||
raspberry-pi."4".apply-overlays-dtmerge = {
|
raspberry-pi."4".apply-overlays-dtmerge = {
|
||||||
enable = lib.mkEnableOption ''
|
enable = lib.mkEnableOption ''
|
||||||
replace deviceTree.applyOverlays implementation to use dtmerge from libraspberrypi.
|
replace deviceTree.applyOverlays implementation to use dtmerge from libraspberrypi.
|
||||||
|
this can resolve issues with applying dtbs for the pi.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue