From e42256fa7f09848faa7c2da7312edf536db8e250 Mon Sep 17 00:00:00 2001 From: Colin Date: Tue, 17 May 2022 05:47:43 +0000 Subject: [PATCH] move boot config into cfg/hardware.nix --- cfg/hardware.nix | 60 +++++++++++++++++++++++++++++++++++++---------- configuration.nix | 42 --------------------------------- 2 files changed, 48 insertions(+), 54 deletions(-) diff --git a/cfg/hardware.nix b/cfg/hardware.nix index de581372..19a31cc3 100644 --- a/cfg/hardware.nix +++ b/cfg/hardware.nix @@ -1,23 +1,59 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. +# this file originates from ‘nixos-generate-config’ +# but has been heavily modified { config, lib, pkgs, modulesPath, ... }: { + # TODO colin: this was autogenerated. what's it do? imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "usbhid" "usb_storage" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ ]; - boot.extraModulePackages = [ ]; + # XXX colin: these four statements were autogenerated and placed here: why? + # boot.initrd.availableKernelModules = [ "xhci_pci" "usbhid" "usb_storage" ]; + # boot.initrd.kernelModules = [ ]; + # boot.kernelModules = [ ]; + # boot.extraModulePackages = [ ]; - # XXX colin: moved to fs-configuration.nix - # fileSystems."/" = - # { device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888"; - # fsType = "ext4"; - # }; + # NixOS defaults to grub: we don't want that. + boot.loader.grub.enable = false; + # Enables the generation of /boot/extlinux/extlinux.conf + boot.loader.generic-extlinux-compatible.enable = true; + boot.loader.raspberryPiColin.enable = true; + boot.loader.raspberryPiColin.uboot.enable = true; + boot.loader.raspberryPiColin.version = 4; + + boot.initrd.availableKernelModules = [ + "bcm2711_thermal" + "bcm_phy_lib" + "brcmfmac" + "brcmutil" + "broadcom" + "clk_raspberrypi" + "drm" # Direct Render Manager + "enclosure" # SCSI ? + "fuse" + "mdio_bcm_unimac" + "pcie_brcmstb" + "raspberrypi_cpufreq" + "raspberrypi_hwmon" + "ses" # SCSI Enclosure Services + "uas" # USB attached storage + "uio" # userspace IO + "uio_pdrv_genirq" + "xhci_pci" + "xhci_pci_renesas" + ]; + boot.initrd.compressor = "gzip"; # defaults to zstd + # hack in the `boot.shell_on_fail` arg since it doesn't seem to work otherwise + boot.initrd.preFailCommands = "allowShell=1"; + # default: 4 (warn). 7 is debug + # boot.consoleLogLevel = 7; + # boot.kernelParams = [ + # "boot.shell_on_fail" + # # "boot.trace" + # # "systemd.log_level=debug" + # # "systemd.log_target=console" + # ]; powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; } diff --git a/configuration.nix b/configuration.nix index 416f8c6a..e44c3160 100644 --- a/configuration.nix +++ b/configuration.nix @@ -42,48 +42,6 @@ in ]; - # NixOS defaults to grub: we don't want that. - boot.loader.grub.enable = false; - # Enables the generation of /boot/extlinux/extlinux.conf - boot.loader.generic-extlinux-compatible.enable = true; - boot.loader.raspberryPiColin.enable = true; - boot.loader.raspberryPiColin.uboot.enable = true; - boot.loader.raspberryPiColin.version = 4; - - boot.initrd.availableKernelModules = [ - "bcm2711_thermal" - "bcm_phy_lib" - "brcmfmac" - "brcmutil" - "broadcom" - "clk_raspberrypi" - "drm" # Direct Render Manager - "enclosure" # SCSI ? - "fuse" - "mdio_bcm_unimac" - "pcie_brcmstb" - "raspberrypi_cpufreq" - "raspberrypi_hwmon" - "ses" # SCSI Enclosure Services - "uas" # USB attached storage - "uio" # userspace IO - "uio_pdrv_genirq" - "xhci_pci" - "xhci_pci_renesas" - ]; - boot.initrd.compressor = "gzip"; # defaults to zstd - # hack in the `boot.shell_on_fail` arg since it doesn't seem to work otherwise - boot.initrd.preFailCommands = "allowShell=1"; - # default: 4 (warn). 7 is debug - # boot.consoleLogLevel = 7; - # boot.kernelParams = [ - # "boot.shell_on_fail" - # # "boot.trace" - # # "systemd.log_level=debug" - # # "systemd.log_target=console" - # ]; - - # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave