From 6a3e7b774171a2d93c2b9c173d921feaca0824ce Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Mon, 12 May 2025 19:09:50 +0200 Subject: [PATCH] Add grub module --- hosts/cirrus/default.nix | 3 ++- modules/system/boot/loader/grub.nix | 11 +++++++++++ .../boot/{loader.nix => loader/systemd-boot.nix} | 2 -- modules/system/boot/silent.nix | 1 + 4 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 modules/system/boot/loader/grub.nix rename modules/system/boot/{loader.nix => loader/systemd-boot.nix} (87%) diff --git a/hosts/cirrus/default.nix b/hosts/cirrus/default.nix index 7541b86..f7b0dda 100644 --- a/hosts/cirrus/default.nix +++ b/hosts/cirrus/default.nix @@ -1,9 +1,10 @@ _: { system.stateVersion = "24.11"; - boot.loader.grub.enable = true; myConfig = { + boot.loader.grub.enable = true; sops.enable = true; + tailscale = { enable = true; ssh.enable = true; diff --git a/modules/system/boot/loader/grub.nix b/modules/system/boot/loader/grub.nix new file mode 100644 index 0000000..36f0252 --- /dev/null +++ b/modules/system/boot/loader/grub.nix @@ -0,0 +1,11 @@ +{ config, lib, ... }: +{ + options.myConfig.boot.loader.grub.enable = lib.mkEnableOption ""; + + config = lib.mkIf config.myConfig.boot.loader.grub.enable { + boot = { + tmp.cleanOnBoot = true; + loader.grub.enable = true; + }; + }; +} diff --git a/modules/system/boot/loader.nix b/modules/system/boot/loader/systemd-boot.nix similarity index 87% rename from modules/system/boot/loader.nix rename to modules/system/boot/loader/systemd-boot.nix index f294447..94498f8 100644 --- a/modules/system/boot/loader.nix +++ b/modules/system/boot/loader/systemd-boot.nix @@ -12,9 +12,7 @@ configurationLimit = 20; }; efi.canTouchEfiVariables = true; - timeout = 0; }; }; - systemd.watchdog.rebootTime = "10"; }; } diff --git a/modules/system/boot/silent.nix b/modules/system/boot/silent.nix index 1548b3d..2b8976a 100644 --- a/modules/system/boot/silent.nix +++ b/modules/system/boot/silent.nix @@ -4,6 +4,7 @@ config = lib.mkIf config.myConfig.boot.silent { boot = { + loader.timeout = 0; kernelParams = [ "quiet" "rd.systemd.show_status=false"