This commit is contained in:
mjallen18
2025-09-02 19:23:08 -05:00
parent e79ae984a3
commit a6167bf31c
16 changed files with 226 additions and 508 deletions

View File

@@ -26,34 +26,18 @@ in
environment.systemPackages =
with pkgs;
[
i2c-tools
libraspberrypi
raspberrypi-eeprom
raspberrypifw
raspberrypiWirelessFirmware
raspberrypi-armstubs
]
++ lib.optionals (cfg.variant == "4") [
i2c-tools
]
++ lib.optionals (cfg.variant == "5") [
erofs-utils
fex
squashfuse
squashfsTools
];
# Common nixpkgs overlays for Raspberry Pi
nixpkgs.overlays = lib.mkAfter [
(_self: super: {
# This is used in (modulesPath + "/hardware/all-firmware.nix") when at least
# enableRedistributableFirmware is enabled
inherit (super) raspberrypiWirelessFirmware;
# Some derivations want to use it as an input,
# e.g. raspberrypi-dtbs, omxplayer, sd-image-* modules
inherit (super) raspberrypifw;
})
];
# Common Bluetooth configuration
systemd.services.btattach = {
before = [ "bluetooth.service" ];
@@ -65,14 +49,13 @@ in
};
# Common hardware settings
hardware.i2c.enable = lib.mkIf (cfg.variant == "4") true;
hardware.i2c.enable = lib.mkDefault true;
# Pi 5 specific settings
hardware.graphics.enable32Bit = lib.mkIf (cfg.variant == "5") (lib.mkForce false);
zramSwap.enable = lib.mkIf (cfg.variant == "5") true;
# Pi specific settings
hardware.graphics.enable32Bit = lib.mkForce false;
# Pi 5 specific system tags
system.nixos.tags = lib.mkIf (cfg.variant == "5") (
# Pi specific system tags
system.nixos.tags = (
let
bootCfg = config.boot.loader.raspberry-pi;
in