diff --git a/hosts/Infini-DESKTOP/default.nix b/hosts/Infini-DESKTOP/default.nix index 8a9a4f8..1485fbc 100644 --- a/hosts/Infini-DESKTOP/default.nix +++ b/hosts/Infini-DESKTOP/default.nix @@ -18,7 +18,6 @@ }; modules = { - boot.grub.enable = true; hardware = { gpu.nvidia = true; wireless.enable = true; diff --git a/hosts/Infini-DL360/default.nix b/hosts/Infini-DL360/default.nix index cb29b69..65f312f 100644 --- a/hosts/Infini-DL360/default.nix +++ b/hosts/Infini-DL360/default.nix @@ -29,12 +29,12 @@ nix.distributedBuilds = false; modules = { - boot.grub.enable = true; - boot.timeout = 5; hardware.form.server = true; virtualization.enable = true; }; + boot.loader.timeout = 5; + persist = { directories = [ "/srv" diff --git a/hosts/Infini-FRAMEWORK/default.nix b/hosts/Infini-FRAMEWORK/default.nix index 4560a88..1737fd2 100644 --- a/hosts/Infini-FRAMEWORK/default.nix +++ b/hosts/Infini-FRAMEWORK/default.nix @@ -20,7 +20,6 @@ nix.settings.extra-platforms = config.boot.binfmt.emulatedSystems; modules = { - boot.grub.enable = true; hardware = { gpu.intel = true; form.laptop = true; diff --git a/hosts/Infini-OPTIPLEX/default.nix b/hosts/Infini-OPTIPLEX/default.nix index 12e28e2..a4547b8 100644 --- a/hosts/Infini-OPTIPLEX/default.nix +++ b/hosts/Infini-OPTIPLEX/default.nix @@ -9,16 +9,13 @@ info.loc.purdue = true; modules = { - boot = { - grub.enable = true; - timeout = 1; - }; - hardware.form.desktop = true; hardware.gpu.intel = true; desktop.wm.enable = true; }; + boot.loader.timeout = 1; + persist = { directories = [ ]; diff --git a/hosts/Infini-RASPBERRY/default.nix b/hosts/Infini-RASPBERRY/default.nix index 42457a9..5d7c716 100644 --- a/hosts/Infini-RASPBERRY/default.nix +++ b/hosts/Infini-RASPBERRY/default.nix @@ -9,7 +9,6 @@ with lib; system.stateVersion = "23.11"; modules = { hardware.form.raspi = true; - boot.ignore = true; }; nixpkgs.overlays = [ diff --git a/hosts/Infini-SD/default.nix b/hosts/Infini-SD/default.nix index 1a7c564..126f45f 100644 --- a/hosts/Infini-SD/default.nix +++ b/hosts/Infini-SD/default.nix @@ -13,7 +13,6 @@ }; modules = { - boot.grub.enable = true; hardware = { form.server = true; }; diff --git a/hosts/Infini-SERVER/default.nix b/hosts/Infini-SERVER/default.nix index 63c5099..a5a5125 100644 --- a/hosts/Infini-SERVER/default.nix +++ b/hosts/Infini-SERVER/default.nix @@ -9,10 +9,6 @@ info.loc.home = true; modules = { - boot = { - grub.enable = true; - timeout = 1; - }; hardware = { # gpu.nvidia = true; form.server = true; @@ -26,6 +22,8 @@ }; }; + boot.loader.timeout = 1; + services = { avahi.reflector = true; }; diff --git a/hosts/Infini-STICK/default.nix b/hosts/Infini-STICK/default.nix index aa120ac..fc355d2 100644 --- a/hosts/Infini-STICK/default.nix +++ b/hosts/Infini-STICK/default.nix @@ -9,7 +9,6 @@ boot.kernelPackages = lib.mkForce config.boot.zfs.package.latestCompatibleLinuxPackages; modules = { - boot.grub.enable = true; hardware = { audio.enable = true; form.portable = true; diff --git a/hosts/Infini-SWIFT/default.nix b/hosts/Infini-SWIFT/default.nix index 633cf2a..c13b106 100644 --- a/hosts/Infini-SWIFT/default.nix +++ b/hosts/Infini-SWIFT/default.nix @@ -9,9 +9,6 @@ powerManagement.resumeCommands = "${pkgs.kmod}/bin/rmod atkbd; ${pkgs.kmod}/bin/modprobe atkbd reset=1"; modules = { - boot = { - grub.enable = true; - }; hardware = { form.laptop = true; gpu.amdgpu = true; diff --git a/modules/global/boot.nix b/modules/global/boot.nix new file mode 100644 index 0000000..ba99ed0 --- /dev/null +++ b/modules/global/boot.nix @@ -0,0 +1,20 @@ +{ lib, ... }: +let + inherit (lib) mkDefault; +in +{ + boot.loader = { + timeout = mkDefault 3; + grub = { + enable = mkDefault true; + device = mkDefault "nodev"; + efiSupport = mkDefault true; + useOSProber = mkDefault false; + efiInstallAsRemovable = mkDefault true; + }; + efi = { + canTouchEfiVariables = mkDefault false; + efiSysMountPoint = mkDefault "/boot/efi"; + }; + }; +} diff --git a/modules/modules/boot.nix b/modules/modules/boot.nix deleted file mode 100644 index 63115c1..0000000 --- a/modules/modules/boot.nix +++ /dev/null @@ -1,60 +0,0 @@ -{ config, options, lib, ... }: -with lib; -with lib.our; -let - cfg = config.modules.boot; - opt = options.modules.boot; -in -{ - options.modules.boot = with types; { - timeout = mkOpt (nullOr int) 3; - - grub = { - enable = mkBoolOpt false; - efiSysMountPoint = mkOpt path "/boot/efi"; - }; - systemd-boot.enable = mkBoolOpt false; - ignore = mkBoolOpt false; - }; - - config = mkMerge [ - { - assertions = [ - { - assertion = (count (v: v) [ cfg.grub.enable cfg.systemd-boot.enable config.wsl.enable cfg.ignore ]) == 1; - message = "Must enable one and only one bootloader"; - } - ]; - - boot.loader.timeout = mkAliasDefinitions opt.timeout; - } - (mkIf cfg.grub.enable { - boot.loader = { - grub = { - enable = mkDefault true; - device = mkDefault "nodev"; - efiSupport = mkDefault true; - useOSProber = mkDefault false; - efiInstallAsRemovable = mkDefault true; - }; - efi = { - canTouchEfiVariables = mkDefault false; - efiSysMountPoint = cfg.grub.efiSysMountPoint; - }; - }; - }) - (mkIf cfg.systemd-boot.enable { - boot.loader = { - systemd-boot = { - enable = mkDefault true; - consoleMode = "2"; - - # See desc in nixpkgs/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix - editor = false; - }; - - efi.canTouchEfiVariables = true; - }; - }) - ]; -} diff --git a/modules/modules/hardware/form.nix b/modules/modules/hardware/form.nix index 03dd0b6..0dcdff1 100644 --- a/modules/modules/hardware/form.nix +++ b/modules/modules/hardware/form.nix @@ -71,6 +71,7 @@ in }) (mkIf cfg.raspi { + boot.loader.grub.enable = false; # imports = [ inputs.nixos-hardware.outputs.nixosModules.raspberry-pi-4 ]; # modules.hardware = {