Add optional zfsSupport to the nixos grub configuration

This commit is contained in:
William A. Kennington III 2014-04-09 13:27:18 -05:00
parent f2bef62716
commit 3c6e2fbba9
2 changed files with 15 additions and 1 deletions

View file

@ -6,7 +6,8 @@ let
cfg = config.boot.loader.grub;
realGrub = if cfg.version == 1 then pkgs.grub else pkgs.grub2;
realGrub = if cfg.version == 1 then pkgs.grub
else pkgs.grub2.override { zfsSupport = cfg.zfsSupport };
grub =
# Don't include GRUB if we're only generating a GRUB menu (e.g.,
@ -209,6 +210,14 @@ in
'';
};
zfsSupport = mkOption {
default = false;
type = types.bool;
description = ''
Whether grub should be build against libzfs.
'';
};
};
};
@ -251,6 +260,9 @@ in
${pkgs.coreutils}/bin/cp -pf "${v}" "/boot/${n}"
'') config.boot.loader.grub.extraFiles);
assertions = [{ assertion = !cfg.zfsSupport || cfg.version == 2;
message = "Only grub version 2 provides zfs support";}];
})
];

View file

@ -1222,6 +1222,8 @@ let
grub2_efi = grub2.override { EFIsupport = true; };
grub2_zfs = grub2.override { zfsSupport = true; };
gssdp = callPackage ../development/libraries/gssdp {
inherit (gnome) libsoup;
};