Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion nixos/modules/system/boot/loader/grub/grub.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ let
inherit (cfg)
version extraConfig extraPerEntryConfig extraEntries
extraEntriesBeforeNixOS extraPrepareConfig configurationLimit copyKernels timeout
default devices;
default devices explicitBootRoot;
path = (makeSearchPath "bin" [
pkgs.coreutils pkgs.gnused pkgs.gnugrep pkgs.findutils pkgs.diffutils
]) + ":" + (makeSearchPath "sbin" [
Expand Down Expand Up @@ -209,6 +209,15 @@ in
'';
};

explicitBootRoot = mkOption {
default = "";
type = types.str;
description = ''
The relative path of /boot within the parent volume. Leave empty
if /boot is not a btrfs subvolume.
'';
};

};

};
Expand Down
5 changes: 5 additions & 0 deletions nixos/modules/system/boot/loader/grub/install-grub.pl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ sub writeFile {
my $copyKernels = get("copyKernels") eq "true";
my $timeout = int(get("timeout"));
my $defaultEntry = int(get("default"));
my $explicitBootRoot = get("explicitBootRoot");
$ENV{'PATH'} = get("path");

die "unsupported GRUB version\n" if $grubVersion != 1 && $grubVersion != 2;
Expand All @@ -61,6 +62,10 @@ sub writeFile {
$copyKernels = 1;
}

if ($explicitBootRoot ne "") {
$bootRoot = $explicitBootRoot;
}


# Generate the header.
my $conf .= "# Automatically generated. DO NOT EDIT THIS FILE!\n";
Expand Down