mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
nixos/grub: allow customization of the nix store path
This commit is contained in:
parent
e1af50c4c4
commit
3754de550f
2 changed files with 12 additions and 1 deletions
|
@ -36,6 +36,7 @@ let
|
||||||
grubEfi = f grubEfi;
|
grubEfi = f grubEfi;
|
||||||
grubTargetEfi = if cfg.efiSupport && (cfg.version == 2) then f (grubEfi.grubTarget or "") else "";
|
grubTargetEfi = if cfg.efiSupport && (cfg.version == 2) then f (grubEfi.grubTarget or "") else "";
|
||||||
bootPath = args.path;
|
bootPath = args.path;
|
||||||
|
storePath = config.boot.loader.grub.storePath;
|
||||||
efiSysMountPoint = if args.efiSysMountPoint == null then args.path else args.efiSysMountPoint;
|
efiSysMountPoint = if args.efiSysMountPoint == null then args.path else args.efiSysMountPoint;
|
||||||
inherit (args) devices;
|
inherit (args) devices;
|
||||||
inherit (efi) canTouchEfiVariables;
|
inherit (efi) canTouchEfiVariables;
|
||||||
|
@ -163,6 +164,15 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
storePath = mkOption {
|
||||||
|
default = "/nix/store";
|
||||||
|
type = types.str;
|
||||||
|
description = ''
|
||||||
|
Path to the Nix store when looking for kernels at boot.
|
||||||
|
Only makes sense when copyKernels is false.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
extraPrepareConfig = mkOption {
|
extraPrepareConfig = mkOption {
|
||||||
default = "";
|
default = "";
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
|
|
|
@ -55,6 +55,7 @@ my $fsIdentifier = get("fsIdentifier");
|
||||||
my $grubEfi = get("grubEfi");
|
my $grubEfi = get("grubEfi");
|
||||||
my $grubTargetEfi = get("grubTargetEfi");
|
my $grubTargetEfi = get("grubTargetEfi");
|
||||||
my $bootPath = get("bootPath");
|
my $bootPath = get("bootPath");
|
||||||
|
my $storePath = get("storePath");
|
||||||
my $canTouchEfiVariables = get("canTouchEfiVariables");
|
my $canTouchEfiVariables = get("canTouchEfiVariables");
|
||||||
my $efiSysMountPoint = get("efiSysMountPoint");
|
my $efiSysMountPoint = get("efiSysMountPoint");
|
||||||
$ENV{'PATH'} = get("path");
|
$ENV{'PATH'} = get("path");
|
||||||
|
@ -210,7 +211,7 @@ sub GrubFs {
|
||||||
my $grubBoot = GrubFs($bootPath);
|
my $grubBoot = GrubFs($bootPath);
|
||||||
my $grubStore;
|
my $grubStore;
|
||||||
if ($copyKernels == 0) {
|
if ($copyKernels == 0) {
|
||||||
$grubStore = GrubFs("/nix/store");
|
$grubStore = GrubFs($storePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
# Generate the header.
|
# Generate the header.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue