1
1
Fork 0
nixos-configs/hardware-configuration.nix

53 lines
1.3 KiB
Nix

{ config, pkgs, lib, ... }:
{
disabledModules = [ "system/boot/loader/raspberrypi/raspberrypi.nix" ];
imports = [ ./modules/system/boot/loader/raspberrypi/raspberrypi.nix ];
boot.loader.grub.enable = false;
boot.loader.raspberryPi = {
enable = true;
version = 3;
firmwareConfig = ''
gpu_mem=192
dtparam=audio=on
disable_overscan=1
hdmi_drive=2
disable_audio_dither=1
# Can be shortened if desired.
boot_delay=10
'';
};
boot.loader.systemd-boot.configurationLimit = 1;
# This is necessary for the rpi3.
boot.kernelPackages = pkgs.linuxPackages_rpi4;
# Enable nonfree firmware (necessary for the rpi)
hardware.enableRedistributableFirmware = true;
boot.supportedFilesystems = [ "ext4" ];
# Log important messages to the system console.
boot.consoleLogLevel = lib.mkDefault 7;
# These are the filesystems defined on the SD image.
fileSystems = {
"/boot" = {
device = "/dev/disk/by-label/FIRMWARE";
fsType = "vfat";
options = [ "nofail" ];
};
"/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
};
};
# Prevent use of swapspace as much as possible
boot.kernel.sysctl = { "vm.swappiness" = 0; };
swapDevices = [ { device = "/swap"; size = 2048; } ];
}