Merge pull request #195805 from Luflosi/grub-use-correct-zfs-version

nixos/grub: use the correct ZFS version
This commit is contained in:
Ryan Lahfa 2023-12-31 21:33:37 +01:00 committed by GitHub
commit e44341e335
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -36,7 +36,7 @@ let
# Package set of targeted architecture
if cfg.forcei686 then pkgs.pkgsi686Linux else pkgs;
realGrub = if cfg.zfsSupport then grubPkgs.grub2.override { zfsSupport = true; }
realGrub = if cfg.zfsSupport then grubPkgs.grub2.override { zfsSupport = true; zfs = cfg.zfsPackage; }
else grubPkgs.grub2;
grub =
@ -614,6 +614,16 @@ in
'';
};
zfsPackage = mkOption {
type = types.package;
internal = true;
default = pkgs.zfs;
defaultText = literalExpression "pkgs.zfs";
description = lib.mdDoc ''
Which ZFS package to use if `config.boot.loader.grub.zfsSupport` is true.
'';
};
efiSupport = mkOption {
default = false;
type = types.bool;

View File

@ -667,6 +667,7 @@ in
# TODO FIXME See https://github.com/NixOS/nixpkgs/pull/99386#issuecomment-798813567. To not break people's bootloader and as probably not everybody would read release notes that thoroughly add inSystem.
boot.loader.grub = mkIf (inInitrd || inSystem) {
zfsSupport = true;
zfsPackage = cfgZfs.package;
};
services.zfs.zed.settings = {