summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hosts/kaworu/default.nix3
-rw-r--r--hosts/kaworu/hardware.nix7
-rw-r--r--hosts/shinji/default.nix6
-rw-r--r--hosts/shinji/hardware.nix18
-rw-r--r--hosts/thinkpad/default.nix3
-rw-r--r--hosts/thinkpad/hardware.nix12
-rw-r--r--options.nix11
-rw-r--r--system/bootloader/default.nix6
-rw-r--r--system/bootloader/grub.nix20
-rw-r--r--system/bootloader/limine.nix24
-rw-r--r--system/default.nix1
11 files changed, 74 insertions, 37 deletions
diff --git a/hosts/kaworu/default.nix b/hosts/kaworu/default.nix
index b85b86d..25c16c7 100644
--- a/hosts/kaworu/default.nix
+++ b/hosts/kaworu/default.nix
@@ -34,6 +34,9 @@
minecraft.enable = true;
steam.enable = true;
};
+ bootloader = {
+ limine.enable = true;
+ };
# modules
amdgpu.enable = true;
diff --git a/hosts/kaworu/hardware.nix b/hosts/kaworu/hardware.nix
index c3c9a57..0f2d277 100644
--- a/hosts/kaworu/hardware.nix
+++ b/hosts/kaworu/hardware.nix
@@ -1,11 +1,4 @@
_: {
- # bootloader
- boot.loader.systemd-boot.enable = true;
- boot.loader.efi = {
- canTouchEfiVariables = true;
- efiSysMountPoint = "/boot/efi";
- };
-
# kernel modules
boot.initrd.availableKernelModules = [
"xhci_pci"
diff --git a/hosts/shinji/default.nix b/hosts/shinji/default.nix
index 916fa52..7e23f4a 100644
--- a/hosts/shinji/default.nix
+++ b/hosts/shinji/default.nix
@@ -83,6 +83,12 @@
enable = true;
ip = "10.3.0.3/32";
};
+ bootloader = {
+ limine = {
+ enable = true;
+ secureBoot.enable = true;
+ };
+ };
# modules
amdgpu.enable = true;
diff --git a/hosts/shinji/hardware.nix b/hosts/shinji/hardware.nix
index b0933f0..1edae37 100644
--- a/hosts/shinji/hardware.nix
+++ b/hosts/shinji/hardware.nix
@@ -8,24 +8,6 @@
inputs.nixos-hardware.nixosModules.lenovo-yoga-7-slim-gen8
];
- # bootloader
- boot.loader = {
- efi.canTouchEfiVariables = true;
- limine = {
- enable = true;
- efiSupport = true;
- secureBoot.enable = true;
- maxGenerations = 10;
- style = {
- backdrop = config.theme.colors.base;
- wallpapers = [config.theme.wallpaper];
- };
- };
-
- grub.enable = false;
- systemd-boot.enable = false;
- };
-
# kernel modules
boot.initrd.availableKernelModules = [
"nvme"
diff --git a/hosts/thinkpad/default.nix b/hosts/thinkpad/default.nix
index 8db964c..e57214d 100644
--- a/hosts/thinkpad/default.nix
+++ b/hosts/thinkpad/default.nix
@@ -37,6 +37,9 @@ _: {
enable = true;
ip = "10.3.0.5/32";
};
+ bootloader = {
+ grub.enable = true;
+ };
# modules
battery.enable = true;
diff --git a/hosts/thinkpad/hardware.nix b/hosts/thinkpad/hardware.nix
index a012cbc..adc160b 100644
--- a/hosts/thinkpad/hardware.nix
+++ b/hosts/thinkpad/hardware.nix
@@ -1,5 +1,4 @@
{
- config,
inputs,
...
}: {
@@ -8,17 +7,6 @@
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-x1-7th-gen
];
- # bootloader
- boot.loader = {
- efi.canTouchEfiVariables = true;
- grub = {
- enable = true;
- efiSupport = true;
- device = "nodev";
- splashImage = config.theme.wallpaper;
- };
- };
-
# kernel modules
boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "usb_storage" "sd_mod"];
boot.initrd.kernelModules = [];
diff --git a/options.nix b/options.nix
index 7b44c32..abd82e1 100644
--- a/options.nix
+++ b/options.nix
@@ -528,6 +528,17 @@ in {
};
#
+ # Different bootloaders to choose from (system only)
+ #
+ bootloader = {
+ grub.enable = mkEnableOption "Enable the grub boot loader";
+ limine = {
+ enable = mkEnableOption "Enable the limine boot loader";
+ secureBoot.enable = mkEnableOption "Enable secure boot for limine";
+ };
+ };
+
+ #
# Virt/VM programs to enable
#
virt = {
diff --git a/system/bootloader/default.nix b/system/bootloader/default.nix
new file mode 100644
index 0000000..8ff8125
--- /dev/null
+++ b/system/bootloader/default.nix
@@ -0,0 +1,6 @@
+_: {
+ imports = [
+ ./grub.nix
+ ./limine.nix
+ ];
+}
diff --git a/system/bootloader/grub.nix b/system/bootloader/grub.nix
new file mode 100644
index 0000000..7f1b31a
--- /dev/null
+++ b/system/bootloader/grub.nix
@@ -0,0 +1,20 @@
+{
+ lib,
+ config,
+ ...
+}: let
+ inherit (lib) mkIf;
+ cfg = config.bootloader.grub;
+in {
+ config = mkIf cfg.enable {
+ boot.loader = {
+ efi.canTouchEfiVariables = true;
+ grub = {
+ enable = true;
+ efiSupport = true;
+ device = "nodev";
+ splashImage = config.theme.wallpaper;
+ };
+ };
+ };
+}
diff --git a/system/bootloader/limine.nix b/system/bootloader/limine.nix
new file mode 100644
index 0000000..3487809
--- /dev/null
+++ b/system/bootloader/limine.nix
@@ -0,0 +1,24 @@
+{
+ lib,
+ config,
+ ...
+}: let
+ inherit (lib) mkIf;
+ cfg = config.bootloader.limine;
+in {
+ config = mkIf cfg.enable {
+ boot.loader = {
+ efi.canTouchEfiVariables = true;
+ limine = {
+ enable = true;
+ efiSupport = true;
+ secureBoot.enable = cfg.secureBoot.enable;
+ maxGenerations = 10;
+ style = {
+ backdrop = config.theme.colors.base;
+ wallpapers = [config.theme.wallpaper];
+ };
+ };
+ };
+ };
+}
diff --git a/system/default.nix b/system/default.nix
index 17462d8..f8101c8 100644
--- a/system/default.nix
+++ b/system/default.nix
@@ -13,6 +13,7 @@ in {
inputs.nix-gaming.nixosModules.platformOptimizations
inputs.nix-gaming.nixosModules.pipewireLowLatency
inputs.nix-gaming.nixosModules.wine
+ ./bootloader
./desktops
./gaming
./virt