mirror of
https://github.com/NixOS/nixos-hardware
synced 2024-11-26 21:09:42 +01:00
apply review suggestions from @06kellyjac
Co-authored-by: j-k <dev@j-k.io>
This commit is contained in:
parent
128dad1c8d
commit
245d8f9f97
2 changed files with 5 additions and 5 deletions
|
@ -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 ''
|
||||
|
|
|
@ -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.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue