diff options
author | Luca Bruno <lucabru@src.gnome.org> | 2015-06-13 15:00:43 +0200 |
---|---|---|
committer | Luca Bruno <lucabru@src.gnome.org> | 2015-06-13 15:02:00 +0200 |
commit | 3754de550f8cb0d1b8f79b40d2865db07c8cdf53 (patch) | |
tree | 19dc12a2181243f54a93c6738e9dc734be034b62 /nixos/modules/system/boot/loader | |
parent | e1af50c4c4c0332136283e9231f0a32ac11f2b90 (diff) | |
download | nixlib-3754de550f8cb0d1b8f79b40d2865db07c8cdf53.tar nixlib-3754de550f8cb0d1b8f79b40d2865db07c8cdf53.tar.gz nixlib-3754de550f8cb0d1b8f79b40d2865db07c8cdf53.tar.bz2 nixlib-3754de550f8cb0d1b8f79b40d2865db07c8cdf53.tar.lz nixlib-3754de550f8cb0d1b8f79b40d2865db07c8cdf53.tar.xz nixlib-3754de550f8cb0d1b8f79b40d2865db07c8cdf53.tar.zst nixlib-3754de550f8cb0d1b8f79b40d2865db07c8cdf53.zip |
nixos/grub: allow customization of the nix store path
Diffstat (limited to 'nixos/modules/system/boot/loader')
-rw-r--r-- | nixos/modules/system/boot/loader/grub/grub.nix | 10 | ||||
-rw-r--r-- | nixos/modules/system/boot/loader/grub/install-grub.pl | 3 |
2 files changed, 12 insertions, 1 deletions
diff --git a/nixos/modules/system/boot/loader/grub/grub.nix b/nixos/modules/system/boot/loader/grub/grub.nix index 0b6333ab573b..e7494161cb38 100644 --- a/nixos/modules/system/boot/loader/grub/grub.nix +++ b/nixos/modules/system/boot/loader/grub/grub.nix @@ -36,6 +36,7 @@ let grubEfi = f grubEfi; grubTargetEfi = if cfg.efiSupport && (cfg.version == 2) then f (grubEfi.grubTarget or "") else ""; bootPath = args.path; + storePath = config.boot.loader.grub.storePath; efiSysMountPoint = if args.efiSysMountPoint == null then args.path else args.efiSysMountPoint; inherit (args) devices; 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 { default = ""; type = types.lines; diff --git a/nixos/modules/system/boot/loader/grub/install-grub.pl b/nixos/modules/system/boot/loader/grub/install-grub.pl index fcf5871203d5..9db6249c450a 100644 --- a/nixos/modules/system/boot/loader/grub/install-grub.pl +++ b/nixos/modules/system/boot/loader/grub/install-grub.pl @@ -55,6 +55,7 @@ my $fsIdentifier = get("fsIdentifier"); my $grubEfi = get("grubEfi"); my $grubTargetEfi = get("grubTargetEfi"); my $bootPath = get("bootPath"); +my $storePath = get("storePath"); my $canTouchEfiVariables = get("canTouchEfiVariables"); my $efiSysMountPoint = get("efiSysMountPoint"); $ENV{'PATH'} = get("path"); @@ -210,7 +211,7 @@ sub GrubFs { my $grubBoot = GrubFs($bootPath); my $grubStore; if ($copyKernels == 0) { - $grubStore = GrubFs("/nix/store"); + $grubStore = GrubFs($storePath); } # Generate the header. |