nixos/hardware.deviceTree: Move things around
In response to comments, create a sub-folder for deviceTree packages (starting with rpi), and a top-level package for helpers.
This commit is contained in:
parent
dd0a951279
commit
28cf80acf8
@ -19,8 +19,8 @@ in {
|
||||
base = mkOption {
|
||||
default = "${config.boot.kernelPackages.kernel}/dtbs";
|
||||
defaultText = "\${config.boot.kernelPackages.kernel}/dtbs";
|
||||
example = literalExample "pkgs.deviceTree.raspberryPiDtbs";
|
||||
type = types.nullOr types.path;
|
||||
example = literalExample "pkgs.deviceTree_rpi";
|
||||
type = types.path;
|
||||
description = ''
|
||||
The package containing the base device-tree (.dtb) to boot. Contains
|
||||
device trees bundled with the Linux kernel by default.
|
||||
@ -30,7 +30,7 @@ in {
|
||||
overlays = mkOption {
|
||||
default = [];
|
||||
example = literalExample
|
||||
"[\"\${pkgs.deviceTree.raspberryPiOverlays}/w1-gpio.dtbo\"]";
|
||||
"[\"\${pkgs.deviceTree_rpi.overlays}/w1-gpio.dtbo\"]";
|
||||
type = types.listOf types.path;
|
||||
description = ''
|
||||
A path containing device tree overlays (.dtbo) to be applied to all
|
||||
@ -41,9 +41,9 @@ in {
|
||||
package = mkOption {
|
||||
default = null;
|
||||
type = types.nullOr types.path;
|
||||
internal = true;
|
||||
description = ''
|
||||
A path containing device tree overlays (.dtbo) to be applied to all
|
||||
base device-trees. Overrides `base` and `overlays`.
|
||||
A path containing the result of applying `overlays` to `base`.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
{ stdenvNoCC, dtc, findutils, raspberrypifw }:
|
||||
{ stdenvNoCC, dtc, findutils }:
|
||||
|
||||
with stdenvNoCC.lib; {
|
||||
applyOverlays = (base: overlays: stdenvNoCC.mkDerivation {
|
||||
@ -14,15 +14,4 @@ with stdenvNoCC.lib; {
|
||||
done
|
||||
'';
|
||||
});
|
||||
|
||||
raspberryPiDtbs = stdenvNoCC.mkDerivation {
|
||||
name = "raspberrypi-dtbs-${raspberrypifw.version}";
|
||||
nativeBuildInputs = [ raspberrypifw ];
|
||||
buildCommand = ''
|
||||
mkdir -p $out/broadcom/
|
||||
cp ${raspberrypifw}/share/raspberrypi/boot/bcm*.dtb $out/broadcom
|
||||
'';
|
||||
};
|
||||
|
||||
raspberryPiOverlays = "${raspberrypifw}/share/raspberrypi/boot/overlays";
|
||||
}
|
14
pkgs/os-specific/linux/device-tree/raspberrypi.nix
Normal file
14
pkgs/os-specific/linux/device-tree/raspberrypi.nix
Normal file
@ -0,0 +1,14 @@
|
||||
{ stdenvNoCC, raspberrypifw }:
|
||||
|
||||
stdenvNoCC.mkDerivation {
|
||||
name = "raspberrypi-dtbs-${raspberrypifw.version}";
|
||||
nativeBuildInputs = [ raspberrypifw ];
|
||||
buildCommand = ''
|
||||
mkdir -p $out/broadcom/
|
||||
cp ${raspberrypifw}/share/raspberrypi/boot/bcm*.dtb $out/broadcom
|
||||
'';
|
||||
passthru = {
|
||||
# Compatible overlays that may be used
|
||||
overlays = "${raspberrypifw}/share/raspberrypi/boot/overlays";
|
||||
};
|
||||
}
|
@ -169,7 +169,9 @@ in
|
||||
|
||||
demoit = callPackage ../servers/demoit { };
|
||||
|
||||
deviceTree = callPackage ../os-specific/linux/device-tree.nix {};
|
||||
deviceTree = callPackage ../os-specific/linux/device-tree {};
|
||||
|
||||
device-tree_rpi = callPackage ../os-specific/linux/device-tree/raspberrypi.nix {};
|
||||
|
||||
diffPlugins = (callPackage ../build-support/plugins.nix {}).diffPlugins;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user