diff options
author | William A. Kennington III <william@wkennington.com> | 2014-04-09 13:27:18 -0500 |
---|---|---|
committer | William A. Kennington III <william@wkennington.com> | 2014-08-28 13:35:34 -0700 |
commit | 3c6e2fbba910cd3f110a0388c0a374d1573082ef (patch) | |
tree | 8e8efc66fdf7fb7d046dbe29665677a451f5ec54 | |
parent | f2bef62716b4c5853ea16465f31182569dbb80ef (diff) | |
download | nixlib-3c6e2fbba910cd3f110a0388c0a374d1573082ef.tar nixlib-3c6e2fbba910cd3f110a0388c0a374d1573082ef.tar.gz nixlib-3c6e2fbba910cd3f110a0388c0a374d1573082ef.tar.bz2 nixlib-3c6e2fbba910cd3f110a0388c0a374d1573082ef.tar.lz nixlib-3c6e2fbba910cd3f110a0388c0a374d1573082ef.tar.xz nixlib-3c6e2fbba910cd3f110a0388c0a374d1573082ef.tar.zst nixlib-3c6e2fbba910cd3f110a0388c0a374d1573082ef.zip |
Add optional zfsSupport to the nixos grub configuration
-rw-r--r-- | nixos/modules/system/boot/loader/grub/grub.nix | 14 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 2 |
2 files changed, 15 insertions, 1 deletions
diff --git a/nixos/modules/system/boot/loader/grub/grub.nix b/nixos/modules/system/boot/loader/grub/grub.nix index a3b09223cbb8..25cec57431e1 100644 --- a/nixos/modules/system/boot/loader/grub/grub.nix +++ b/nixos/modules/system/boot/loader/grub/grub.nix @@ -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";}]; + }) ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c5b511df9c02..2dc957cb3db3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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; }; |