fmt
This commit is contained in:
@@ -17,6 +17,9 @@
|
||||
examples = import ./examples { inherit inputs; };
|
||||
|
||||
# Import versioning utilities
|
||||
versioning = import ./versioning { lib = inputs.nixpkgs.lib; inherit inputs; };
|
||||
versioning = import ./versioning {
|
||||
lib = inputs.nixpkgs.lib;
|
||||
inherit inputs;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
{ lib, inputs, system ? "aarch64-linux" }:
|
||||
{
|
||||
lib,
|
||||
inputs,
|
||||
system ? "aarch64-linux",
|
||||
}:
|
||||
let
|
||||
pkgs = inputs.nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
in
|
||||
let
|
||||
inherit (builtins)
|
||||
isAttrs
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
{ config, lib, pkgs, namespace, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
namespace,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib.${namespace}) mkOpt mkBoolOpt;
|
||||
inherit (lib.${namespace}) mkOpt;
|
||||
cfg = config.${namespace}.hardware.raspberry-pi.overlays;
|
||||
|
||||
firmware = "${pkgs.${namespace}.raspberrypifw}/share/raspberrypi/boot/overlays";
|
||||
@@ -115,140 +121,140 @@ in
|
||||
description = "Apply Raspberry Pi Device Tree Overlays";
|
||||
script = ''
|
||||
echo "Applying Device Tree Overlays via ConfigFS"
|
||||
|
||||
|
||||
if [ ${if cfg.pi5DisableWifi.enable then "true" else "false"} ]; then
|
||||
mkdir -p ${toString configfsPath}/disable-wifi-pi5
|
||||
cp ${cfg.pi5DisableWifi.overlay} ${configfsPath}/disable-wifi-pi5/dtbo
|
||||
else
|
||||
rm -rf ${toString configfsPath}/disable-wifi-pi5
|
||||
fi
|
||||
|
||||
|
||||
if [ ${if cfg.pi5DisableBluetooth.enable then "true" else "false"} ]; then
|
||||
mkdir -p ${toString configfsPath}/disable-bt-pi5
|
||||
cp ${cfg.pi5DisableBluetooth.overlay} ${configfsPath}/disable-bt-pi5/dtbo
|
||||
else
|
||||
rm -rf ${toString configfsPath}/disable-bt-pi5
|
||||
fi
|
||||
|
||||
|
||||
if [ ${if cfg.pi5i2c0.enable then "true" else "false"} ]; then
|
||||
mkdir -p ${toString configfsPath}/i2c0-pi5
|
||||
cp ${cfg.pi5i2c0.overlay} ${configfsPath}/i2c0-pi5/dtbo
|
||||
else
|
||||
rm -rf ${toString configfsPath}/i2c0-pi5
|
||||
fi
|
||||
|
||||
|
||||
if [ ${if cfg.pi5i2c1.enable then "true" else "false"} ]; then
|
||||
mkdir -p ${toString configfsPath}/i2c1-pi5
|
||||
cp ${cfg.pi5i2c1.overlay} ${configfsPath}/i2c1-pi5/dtbo
|
||||
else
|
||||
rm -rf ${toString configfsPath}/i2c1-pi5
|
||||
fi
|
||||
|
||||
|
||||
if [ ${if cfg.pi5i2c2.enable then "true" else "false"} ]; then
|
||||
mkdir -p ${toString configfsPath}/i2c2-pi5
|
||||
cp ${cfg.pi5i2c2.overlay} ${configfsPath}/i2c2-pi5/dtbo
|
||||
else
|
||||
rm -rf ${toString configfsPath}/i2c2-pi5
|
||||
fi
|
||||
|
||||
|
||||
if [ ${if cfg.pi5i2c3.enable then "true" else "false"} ]; then
|
||||
mkdir -p ${toString configfsPath}/i2c3-pi5
|
||||
cp ${cfg.pi5i2c3.overlay} ${configfsPath}/i2c3-pi5/dtbo
|
||||
else
|
||||
rm -rf ${toString configfsPath}/i2c3-pi5
|
||||
fi
|
||||
|
||||
|
||||
if [ ${if cfg.pi5Sdio.enable then "true" else "false"} ]; then
|
||||
mkdir ${toString configfsPath}/sdio-pi5
|
||||
cp ${cfg.pi5Sdio.overlay} ${configfsPath}/sdio-pi5/dtbo
|
||||
else
|
||||
rm -rf ${toString configfsPath}/sdio-pi5
|
||||
fi
|
||||
|
||||
|
||||
if [ ${if cfg.pi5Spi21cs.enable then "true" else "false"} ]; then
|
||||
mkdir ${toString configfsPath}/spi2-1cs-pi5
|
||||
cp ${cfg.pi5Spi21cs.overlay} ${configfsPath}/spi2-1cs-pi5/dtbo
|
||||
else
|
||||
rm -rf ${toString configfsPath}/spi2-1cs-pi5
|
||||
fi
|
||||
|
||||
|
||||
if [ ${if cfg.pi5Spi22cs.enable then "true" else "false"} ]; then
|
||||
mkdir ${toString configfsPath}/spi2-2cs-pi5
|
||||
cp ${cfg.pi5Spi22cs.overlay} ${configfsPath}/spi2-2cs-pi5/dtbo
|
||||
else
|
||||
rm -rf ${toString configfsPath}/spi2-2cs-pi5
|
||||
fi
|
||||
|
||||
|
||||
if [ ${if cfg.pi5Spi31cs.enable then "true" else "false"} ]; then
|
||||
mkdir ${toString configfsPath}/spi3-1cs-pi5
|
||||
cp ${cfg.pi5Spi31cs.overlay} ${configfsPath}/spi3-1cs-pi5/dtbo
|
||||
else
|
||||
rm -rf ${toString configfsPath}/spi3-1cs-pi5
|
||||
fi
|
||||
|
||||
|
||||
if [ ${if cfg.pi5Spi32cs.enable then "true" else "false"} ]; then
|
||||
mkdir ${toString configfsPath}/spi3-2cs-pi5
|
||||
cp ${cfg.pi5Spi32cs.overlay} ${configfsPath}/spi3-2cs-pi5/dtbo
|
||||
else
|
||||
rm -rf ${toString configfsPath}/spi3-2cs-pi5
|
||||
fi
|
||||
|
||||
|
||||
if [ ${if cfg.pi5Spi51cs.enable then "true" else "false"} ]; then
|
||||
mkdir ${toString configfsPath}/spi5-1cs-pi5
|
||||
cp ${cfg.pi5Spi51cs.overlay} ${configfsPath}/spi5-1cs-pi5/dtbo
|
||||
else
|
||||
rm -rf ${toString configfsPath}/spi5-1cs-pi5
|
||||
fi
|
||||
|
||||
|
||||
if [ ${if cfg.pi5Spi52cs.enable then "true" else "false"} ]; then
|
||||
mkdir ${toString configfsPath}/spi5-2cs-pi5
|
||||
cp ${cfg.pi5Spi52cs.overlay} ${configfsPath}/spi5-2cs-pi5/dtbo
|
||||
else
|
||||
rm -rf ${toString configfsPath}/spi5-2cs-pi5
|
||||
fi
|
||||
|
||||
|
||||
if [ ${if cfg.pi5Uart0.enable then "true" else "false"} ]; then
|
||||
mkdir ${toString configfsPath}/uart0-pi5
|
||||
cp ${cfg.pi5Uart0.overlay} ${configfsPath}/uart0-pi5/dtbo
|
||||
else
|
||||
rm -rf ${toString configfsPath}/uart0-pi5
|
||||
fi
|
||||
|
||||
|
||||
if [ ${if cfg.pi5Uart1.enable then "true" else "false"} ]; then
|
||||
mkdir ${toString configfsPath}/uart1-pi5
|
||||
cp ${cfg.pi5Uart1.overlay} ${configfsPath}/uart1-pi5/dtbo
|
||||
else
|
||||
rm -rf ${toString configfsPath}/uart1-pi5
|
||||
fi
|
||||
|
||||
|
||||
if [ ${if cfg.pi5Uart2.enable then "true" else "false"} ]; then
|
||||
mkdir ${toString configfsPath}/uart2-pi5
|
||||
cp ${cfg.pi5Uart2.overlay} ${configfsPath}/uart2-pi5/dtbo
|
||||
else
|
||||
rm -rf ${toString configfsPath}/uart2-pi5
|
||||
fi
|
||||
|
||||
|
||||
if [ ${if cfg.pi5Uart3.enable then "true" else "false"} ]; then
|
||||
mkdir ${toString configfsPath}/uart3-pi5
|
||||
cp ${cfg.pi5Uart3.overlay} ${configfsPath}/uart3-pi5/dtbo
|
||||
else
|
||||
rm -rf ${toString configfsPath}/uart3-pi5
|
||||
fi
|
||||
|
||||
|
||||
if [ ${if cfg.pi5Uart4.enable then "true" else "false"} ]; then
|
||||
mkdir ${toString configfsPath}/uart4-pi5
|
||||
cp ${cfg.pi5Uart4.overlay} ${configfsPath}/uart4-pi5/dtbo
|
||||
else
|
||||
rm -rf ${toString configfsPath}/uart4-pi5
|
||||
fi
|
||||
|
||||
|
||||
if [ ${if cfg.pi5Vc4Kms.enable then "true" else "false"} ]; then
|
||||
mkdir ${toString configfsPath}/vc4-kms-v3d-pi5
|
||||
cp ${cfg.pi5Vc4Kms.overlay} ${configfsPath}/vc4-kms-v3d-pi5/dtbo
|
||||
else
|
||||
rm -rf ${toString configfsPath}/vc4-kms-v3d-pi5
|
||||
fi
|
||||
|
||||
|
||||
if [ ${if cfg.bcm2712d0.enable then "true" else "false"} ]; then
|
||||
mkdir ${toString configfsPath}/bcm2712d0
|
||||
cp ${cfg.bcm2712d0.overlay} ${configfsPath}/bcm2712d0/dtbo
|
||||
|
||||
@@ -46,7 +46,6 @@ in
|
||||
stdenv.mkDerivation rec {
|
||||
inherit pname version;
|
||||
|
||||
|
||||
# Add required host tools if needed:
|
||||
nativeBuildInputs = [
|
||||
openssl
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
let
|
||||
inherit (stdenv) isx86_64 isAarch64 isLinux;
|
||||
inherit (lib.trivial) importJSON;
|
||||
inherit (lib.${namespace}) selectVariant mkAllSources;
|
||||
inherit (lib.${namespace}) selectVariant;
|
||||
|
||||
arch = (if isx86_64 then "x86_64" else "aarch64");
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
}:
|
||||
let
|
||||
inherit (lib.trivial) importJSON;
|
||||
inherit (lib.${namespace}) selectVariant mkAllSources;
|
||||
inherit (lib.${namespace}) selectVariant;
|
||||
|
||||
versionSpec = importJSON ./version.json;
|
||||
selected = selectVariant versionSpec variant null;
|
||||
|
||||
Reference in New Issue
Block a user