diff --git a/devices/pi3b/default.nix b/devices/pi3b/default.nix index 7bbb2659..b4d18a97 100644 --- a/devices/pi3b/default.nix +++ b/devices/pi3b/default.nix @@ -24,6 +24,7 @@ inputs: networking = { hostname = "pi3b"; networkd = {}; }; binfmt.enable = false; nixpkgs.arch = "aarch64"; + kernel.varient = "rpi3"; }; packages.packageSet = "server"; }; diff --git a/modules/system/grub.nix b/modules/system/grub.nix index 9bab806f..5a177c29 100644 --- a/modules/system/grub.nix +++ b/modules/system/grub.nix @@ -34,7 +34,7 @@ inputs: { boot.loader.grub = { - memtest86.enable = true; + memtest86.enable = inputs.lib.mkIf (inputs.config.nixos.system.nixpkgs.arch == "x86_64") true; extraFiles = inputs.lib.mkIf (builtins.elem grub.installDevice [ "efi" "efiRemovable" ]) { "shell.efi" = "${inputs.pkgs.edk2-uefi-shell}/shell.efi"; }; extraEntries = inputs.lib.mkMerge (builtins.concatLists diff --git a/modules/system/kernel/default.nix b/modules/system/kernel/default.nix index fa9e139e..b6c418a4 100644 --- a/modules/system/kernel/default.nix +++ b/modules/system/kernel/default.nix @@ -4,7 +4,7 @@ inputs: { varient = mkOption { - type = types.enum [ "xanmod-lts" "xanmod-latest" "cachyos" "cachyos-lto" ]; + type = types.enum [ "xanmod-lts" "xanmod-latest" "cachyos" "cachyos-lto" "rpi3" ]; default = "xanmod-lts"; }; patches = mkOption { type = types.listOf types.nonEmptyStr; default = []; }; @@ -25,12 +25,18 @@ inputs: # modprobe --show-depends initrd.availableKernelModules = [ - "ahci" "ata_piix" "bfq" "failover" "net_failover" "nls_cp437" "nls_iso8859-1" "nvme" "sdhci_acpi" "sd_mod" + "bfq" "failover" "net_failover" "nls_cp437" "nls_iso8859-1" "sd_mod" "sr_mod" "usbcore" "usbhid" "usbip-core" "usb-common" "usb_storage" "vhci-hcd" "virtio" "virtio_blk" - "virtio_net" "virtio_pci" "xhci_pci" "virtio_ring" "virtio_scsi" "cryptd" "crypto_simd" "libaes" - # networking for nas - "igb" - ]; + "virtio_net" "virtio_ring" "virtio_scsi" "cryptd" "libaes" + ] + ++ ( + inputs.lib.optionals (kernel.varient != "rpi3") + [ + "ahci" "ata_piix" "nvme" "sdhci_acpi" "virtio_pci" "xhci_pci" "crypto_simd" + # networking for nas + "igb" + ] + ); extraModulePackages = (with inputs.config.boot.kernelPackages; [ v4l2loopback ]) ++ kernel.modules.install; extraModprobeConfig = builtins.concatStringsSep "\n" kernel.modules.modprobeConfig; kernelParams = [ "delayacct" "acpi_osi=Linux" "acpi.ec_no_wakeup=1" ]; @@ -40,6 +46,7 @@ inputs: xanmod-latest = inputs.pkgs.linuxPackages_xanmod_latest; cachyos = inputs.pkgs.linuxPackages_cachyos; cachyos-lto = inputs.pkgs.linuxPackages_cachyos-lto; + rpi3 = inputs.pkgs.linuxPackages_rpi3; }.${kernel.varient}; kernelPatches = let @@ -148,5 +155,9 @@ inputs: in { environment.systemPackages = [ scx ]; } ) ) + ( + inputs.lib.mkIf (kernel.varient == "rpi3") + { boot.initrd = { systemd.enableTpm2 = false; includeDefaultModules = false; }; } + ) ]; }