Allow configuring GRUB in the nix config

This commit is contained in:
Manuel Thalmann 2024-07-16 22:17:55 +02:00
parent 7ef8e8ff18
commit 85da9c0ec9
2 changed files with 17 additions and 2 deletions

View file

@ -14,6 +14,20 @@
options = { options = {
valhalla = { 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 = { setupUser = {
name = mkOption { name = mkOption {
type = types.str; type = types.str;

View file

@ -1,4 +1,4 @@
{ ... }: { lib, config, ... }:
let let
fs = import ../../lib/modules/partition/fs.nix; fs = import ../../lib/modules/partition/fs.nix;
in { in {
@ -16,7 +16,7 @@
type = "uefi"; type = "uefi";
size = "+1G"; size = "+1G";
format = fs.fat32; format = fs.fat32;
mountPoint = "/boot"; mountPoint = config.valhalla.boot.efiMountPoint;
}; };
Swap = { Swap = {
@ -26,6 +26,7 @@
OS = { OS = {
index = 3; index = 3;
label = lib.mkDefault config.valhalla.boot.label;
type = "linux"; type = "linux";
format = fs.ext4; format = fs.ext4;
mountPoint = "/"; mountPoint = "/";