From f86f184345bcad97fc7ad8e01c1de8435d846209 Mon Sep 17 00:00:00 2001 From: Chris Toph Date: Tue, 4 Mar 2025 14:21:45 -0500 Subject: [PATCH] Refactor boot configuration, not all machines share bootloader --- hosts/nixos/rune/default.nix | 18 ------------- hosts/nixos/rune/hardware.nix | 13 ++++++++++ hosts/nixos/vm/default.nix | 19 +++----------- hosts/nixos/vm/hardware.nix | 39 ++++++++++++++++++----------- installer/minimal-configuration.nix | 10 ++++---- 5 files changed, 46 insertions(+), 53 deletions(-) diff --git a/hosts/nixos/rune/default.nix b/hosts/nixos/rune/default.nix index 0e5e7d1..1a8b262 100644 --- a/hosts/nixos/rune/default.nix +++ b/hosts/nixos/rune/default.nix @@ -90,24 +90,6 @@ in enableIPv6 = false; }; - ## Boot ## - boot = { - loader = { - systemd-boot = { - enable = true; - # When using plymouth, initrd can expand by a lot each time, so limit how many we keep around - configurationLimit = lib.mkDefault 10; - }; - efi.canTouchEfiVariables = true; - timeout = 3; - }; - - initrd = { - systemd.enable = true; - verbose = false; - }; - }; - ## System-wide packages ## environment.systemPackages = with pkgs; [ asdf-vm diff --git a/hosts/nixos/rune/hardware.nix b/hosts/nixos/rune/hardware.nix index 4a3722a..2d4e59e 100644 --- a/hosts/nixos/rune/hardware.nix +++ b/hosts/nixos/rune/hardware.nix @@ -12,8 +12,21 @@ { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + ## Boot ## boot = { + loader = { + systemd-boot = { + enable = true; + # When using plymouth, initrd can expand by a lot each time, so limit how many we keep around + configurationLimit = lib.mkDefault 10; + }; + efi.canTouchEfiVariables = true; + timeout = 3; + }; + initrd = { + systemd.enable = true; + verbose = false; availableKernelModules = [ "nvme" "xhci_pci" diff --git a/hosts/nixos/vm/default.nix b/hosts/nixos/vm/default.nix index 8ca16fc..969fd33 100644 --- a/hosts/nixos/vm/default.nix +++ b/hosts/nixos/vm/default.nix @@ -1,7 +1,7 @@ ############################################################### # -# Rune - Main Desktop -# NixOS running on Ryzen 9 7900X3D , Radeon RX 6950 XT, 32GB RAM +# VM - Testing Virtual Machine +# NixOS running in VM # ############################################################### @@ -33,7 +33,7 @@ in ## Misc Inputs ## ## VM Specific ## - "hosts/users/${username}" # # Not the best solution but I always have one user so ¯\_(ツ)_/¯ + "hosts/users/${username}" # Not the best solution but I always have just one user so ¯\_(ツ)_/¯ ]) ]; @@ -54,19 +54,6 @@ in enableIPv6 = false; }; - ## Boot ## - boot = { - loader = { - efi.canTouchEfiVariables = true; - timeout = 3; - }; - - initrd = { - systemd.enable = true; - verbose = false; - }; - }; - ## System-wide packages ## environment.systemPackages = with pkgs; [ openssh diff --git a/hosts/nixos/vm/hardware.nix b/hosts/nixos/vm/hardware.nix index 75fe156..43b2486 100644 --- a/hosts/nixos/vm/hardware.nix +++ b/hosts/nixos/vm/hardware.nix @@ -14,21 +14,32 @@ (modulesPath + "/profiles/qemu-guest.nix") ]; - # Bootloader. - boot.loader.grub.enable = true; - boot.loader.grub.device = "/dev/vda"; - boot.loader.grub.useOSProber = true; + ## Boot ## + boot = { + loader = { + grub = { + enable = true; + device = "/dev/vda"; + useOSProber = true; + }; + efi.canTouchEfiVariables = true; + timeout = 3; + }; - boot.initrd.availableKernelModules = [ - "ahci" - "xhci_pci" - "virtio_pci" - "sr_mod" - "virtio_blk" - ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; + initrd = { + availableKernelModules = [ + "ahci" + "xhci_pci" + "virtio_pci" + "sr_mod" + "virtio_blk" + ]; + systemd.enable = true; + verbose = false; + }; + kernelModules = [ "kvm-amd" ]; + extraModulePackages = [ ]; + }; fileSystems."/" = { device = "/dev/disk/by-uuid/a0b82536-3087-410a-b283-60ea10811ef5"; diff --git a/installer/minimal-configuration.nix b/installer/minimal-configuration.nix index 6963dec..4e49c0f 100644 --- a/installer/minimal-configuration.nix +++ b/installer/minimal-configuration.nix @@ -37,11 +37,11 @@ systemd.emergencyAccess = true; # Don't need to enter password in emergency mode }; boot.kernelParams = [ - # "systemd.setenv=SYSTEMD_SULOGIN_FORCE=1" - # "systemd.show_status=true" - #"systemd.log_level=debug" - # "systemd.log_target=console" - # "systemd.journald.forward_to_console=1" + "systemd.setenv=SYSTEMD_SULOGIN_FORCE=1" + "systemd.show_status=true" + "systemd.log_level=debug" + "systemd.log_target=console" + "systemd.journald.forward_to_console=1" ]; environment.systemPackages = builtins.attrValues {