cleanup
This commit is contained in:
@@ -19,59 +19,91 @@ in
|
||||
};
|
||||
|
||||
pi5i2c0 = {
|
||||
enable = lib.mkEnableOption "Disable pi5i2c0 on Pi5";
|
||||
overlay = mkOpt types.str "${firmware}/share/raspberrypi/boot/overlays/i2c0-pi5.dtbo" "Location of the dtbo file";
|
||||
enable = lib.mkEnableOption "Enable pi5i2c0 on Pi5";
|
||||
overlay = mkOpt types.str "${firmware}/boot/overlays/i2c0-pi5.dtbo" "Location of the dtbo file";
|
||||
};
|
||||
|
||||
pi5i2c1 = {
|
||||
enable = lib.mkEnableOption "Disable pi5i2c1 on Pi5";
|
||||
overlay = mkOpt types.str "${firmware}/share/raspberrypi/boot/overlays/i2c1-pi5.dtbo" "Location of the dtbo file";
|
||||
enable = lib.mkEnableOption "Enable pi5i2c1 on Pi5";
|
||||
overlay = mkOpt types.str "${firmware}/boot/overlays/i2c1-pi5.dtbo" "Location of the dtbo file";
|
||||
};
|
||||
|
||||
pi5i2c2 = {
|
||||
enable = lib.mkEnableOption "Disable pi5i2c2 on Pi5";
|
||||
overlay = mkOpt types.str "${firmware}/share/raspberrypi/boot/overlays/i2c2-pi5.dtbo" "Location of the dtbo file";
|
||||
enable = lib.mkEnableOption "Enable pi5i2c2 on Pi5";
|
||||
overlay = mkOpt types.str "${firmware}/boot/overlays/i2c2-pi5.dtbo" "Location of the dtbo file";
|
||||
};
|
||||
|
||||
pi5i2c3 = {
|
||||
enable = lib.mkEnableOption "Disable pi5i2c3 on Pi5";
|
||||
overlay = mkOpt types.str "${firmware}/share/raspberrypi/boot/overlays/i2c3-pi5.dtbo" "Location of the dtbo file";
|
||||
enable = lib.mkEnableOption "Enable pi5i2c3 on Pi5";
|
||||
overlay = mkOpt types.str "${firmware}/boot/overlays/i2c3-pi5.dtbo" "Location of the dtbo file";
|
||||
};
|
||||
|
||||
pi5Sdio = {
|
||||
enable = lib.mkEnableOption "Enable sdio-pi5.dtbo on Pi5";
|
||||
overlay = mkOpt types.str "${firmware}/boot/overlays/sdio-pi5.dtbo" "Location of the dtbo file";
|
||||
};
|
||||
|
||||
pi5Spi21cs = {
|
||||
enable = lib.mkEnableOption "Enable spi2-1cs-pi5.dtbo on Pi5";
|
||||
overlay = mkOpt types.str "${firmware}/boot/overlays/spi2-1cs-pi5.dtbo" "Location of the dtbo file";
|
||||
};
|
||||
|
||||
pi5Spi22cs = {
|
||||
enable = lib.mkEnableOption "Enable spi2-2cs-pi5.dtbo on Pi5";
|
||||
overlay = mkOpt types.str "${firmware}/boot/overlays/spi2-2cs-pi5.dtbo" "Location of the dtbo file";
|
||||
};
|
||||
|
||||
pi5Spi31cs = {
|
||||
enable = lib.mkEnableOption "Enable spi3-1cs-pi5.dtbo on Pi5";
|
||||
overlay = mkOpt types.str "${firmware}/boot/overlays/spi3-1cs-pi5.dtbo" "Location of the dtbo file";
|
||||
};
|
||||
|
||||
pi5Spi32cs = {
|
||||
enable = lib.mkEnableOption "Enable spi3-2cs-pi5.dtbo on Pi5";
|
||||
overlay = mkOpt types.str "${firmware}/boot/overlays/spi3-2cs-pi5.dtbo" "Location of the dtbo file";
|
||||
};
|
||||
|
||||
pi5Spi51cs = {
|
||||
enable = lib.mkEnableOption "Enable spi5-1cs-pi5.dtbo on Pi5";
|
||||
overlay = mkOpt types.str "${firmware}/boot/overlays/spi5-1cs-pi5.dtbo" "Location of the dtbo file";
|
||||
};
|
||||
|
||||
pi5Spi52cs = {
|
||||
enable = lib.mkEnableOption "Enable spi5-2cs-pi5.dtbo on Pi5";
|
||||
overlay = mkOpt types.str "${firmware}/boot/overlays/spi5-1cs-pi5.dtbo" "Location of the dtbo file";
|
||||
};
|
||||
|
||||
pi5Uart0 = {
|
||||
enable = lib.mkEnableOption "Enable pi5Uart0 on Pi5";
|
||||
overlay = mkOpt types.str "${firmware}/boot/overlays/uart0-pi5.dtbo" "Location of the dtbo file";
|
||||
};
|
||||
|
||||
pi5Uart1 = {
|
||||
enable = lib.mkEnableOption "Enable pi5Uart1 on Pi5";
|
||||
overlay = mkOpt types.str "${firmware}/boot/overlays/uart1-pi5.dtbo" "Location of the dtbo file";
|
||||
};
|
||||
|
||||
pi5Uart2 = {
|
||||
enable = lib.mkEnableOption "Enable pi5Uart2 on Pi5";
|
||||
overlay = mkOpt types.str "${firmware}/boot/overlays/uart2-pi5.dtbo" "Location of the dtbo file";
|
||||
};
|
||||
|
||||
pi5Uart3 = {
|
||||
enable = lib.mkEnableOption "Enable pi5Uart3 on Pi5";
|
||||
overlay = mkOpt types.str "${firmware}/boot/overlays/uart3-pi5.dtbo" "Location of the dtbo file";
|
||||
};
|
||||
|
||||
pi5Uart4 = {
|
||||
enable = lib.mkEnableOption "Enable pi5Uart4 on Pi5";
|
||||
overlay = mkOpt types.str "${firmware}/boot/overlays/uart4-pi5.dtbo" "Location of the dtbo file";
|
||||
};
|
||||
|
||||
pi5Vc4Kms = {
|
||||
enable = lib.mkEnableOption "Enable vc4-kms-v3d-pi5.dtbo on Pi5";
|
||||
overlay = mkOpt types.str "${firmware}/boot/overlays/vc4-kms-v3d-pi5.dtbo" "Location of the dtbo file";
|
||||
};
|
||||
};
|
||||
|
||||
# audremap-pi5.dtbo
|
||||
# i2c0-pi5.dtbo
|
||||
# i2c1-pi5.dtbo
|
||||
# i2c2-pi5.dtbo
|
||||
# i2c3-pi5.dtbo
|
||||
# imx500-pi5.dtbo
|
||||
# midi-uart0-pi5.dtbo
|
||||
# midi-uart1-pi5.dtbo
|
||||
# midi-uart2-pi5.dtbo
|
||||
# midi-uart3-pi5.dtbo
|
||||
# midi-uart4-pi5.dtbo
|
||||
# pcie-32bit-dma-pi5.dtbo
|
||||
# pciex1-compat-pi5.dtbo
|
||||
# pisound-pi5.dtbo
|
||||
# sdio-pi5.dtbo
|
||||
# spi2-1cs-pi5.dtbo
|
||||
# spi2-2cs-pi5.dtbo
|
||||
# spi3-1cs-pi5.dtbo
|
||||
# spi3-2cs-pi5.dtbo
|
||||
# spi5-1cs-pi5.dtbo
|
||||
# spi5-1cs.dtbo
|
||||
# spi5-2cs-pi5.dtbo
|
||||
# spi5-2cs.dtbo
|
||||
# tc358743-pi5.dtbo
|
||||
# uart0-pi5.dtbo
|
||||
# uart1-pi5.dtbo
|
||||
# uart2-pi5.dtbo
|
||||
# uart3-pi5.dtbo
|
||||
# uart4-pi5.dtbo
|
||||
# vc4-kms-v3d-pi5.dtbo
|
||||
# w1-gpio-pi5.dtbo
|
||||
# w1-gpio-pullup-pi5.dtbo
|
||||
|
||||
config = {
|
||||
systemd.services = {
|
||||
apply-overlays = {
|
||||
@@ -82,31 +114,134 @@ in
|
||||
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
|
||||
'';
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
@@ -59,6 +59,19 @@
|
||||
pi5i2c1.enable = true;
|
||||
pi5i2c2.enable = true;
|
||||
pi5i2c3.enable = true;
|
||||
pi5Sdio.enable = true;
|
||||
pi5Spi21cs.enable = true;
|
||||
pi5Spi22cs.enable = true;
|
||||
pi5Spi31cs.enable = true;
|
||||
pi5Spi32cs.enable = true;
|
||||
pi5Spi51cs.enable = true;
|
||||
pi5Spi52cs.enable = true;
|
||||
pi5Uart0.enable = true;
|
||||
pi5Uart1.enable = true;
|
||||
pi5Uart2.enable = true;
|
||||
pi5Uart3.enable = true;
|
||||
pi5Uart4.enable = true;
|
||||
pi5Vc4Kms.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user