1
0
Fork 0
mirror of https://github.com/NixOS/nixos-hardware synced 2024-11-23 03:19:42 +01:00

apply review suggestions from @06kellyjac

Co-authored-by: j-k <dev@j-k.io>
This commit is contained in:
Karolis Stasaitis 2022-08-08 18:27:49 +02:00 committed by GitHub
parent 128dad1c8d
commit 245d8f9f97
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -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 ''

View file

@ -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.
'';
};
};