From 85da9c0ec9e57cb0784de4532b902f07ad85750b Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Tue, 16 Jul 2024 22:17:55 +0200 Subject: [PATCH] Allow configuring GRUB in the `nix` config --- lib/modules/valhalla.nix | 14 ++++++++++++++ profiles/Generic/config.nix | 5 +++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/modules/valhalla.nix b/lib/modules/valhalla.nix index 7701bab5..e3e1ad14 100644 --- a/lib/modules/valhalla.nix +++ b/lib/modules/valhalla.nix @@ -14,6 +14,20 @@ options = { valhalla = { + boot = { + efiMountPoint = mkOption { + type = types.str; + description = "The mountpoint of the efi partition."; + default = "/boot"; + }; + + label = mkOption { + type = types.str; + description = "The label of the boot entry."; + default = "OS"; + }; + }; + setupUser = { name = mkOption { type = types.str; diff --git a/profiles/Generic/config.nix b/profiles/Generic/config.nix index 8f2bf4fb..ddfe9bb3 100644 --- a/profiles/Generic/config.nix +++ b/profiles/Generic/config.nix @@ -1,4 +1,4 @@ -{ ... }: +{ lib, config, ... }: let fs = import ../../lib/modules/partition/fs.nix; in { @@ -16,7 +16,7 @@ type = "uefi"; size = "+1G"; format = fs.fat32; - mountPoint = "/boot"; + mountPoint = config.valhalla.boot.efiMountPoint; }; Swap = { @@ -26,6 +26,7 @@ OS = { index = 3; + label = lib.mkDefault config.valhalla.boot.label; type = "linux"; format = fs.ext4; mountPoint = "/";