From c6bd6d6d89abee84d08f12786086ef9e4ccd0860 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Thu, 4 Sep 2014 09:15:59 -0700 Subject: [PATCH] nixos/grub: Assert devices should be absolute paths --- nixos/modules/system/boot/loader/grub/grub.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nixos/modules/system/boot/loader/grub/grub.nix b/nixos/modules/system/boot/loader/grub/grub.nix index 892cd995a519..0269b95ae1db 100644 --- a/nixos/modules/system/boot/loader/grub/grub.nix +++ b/nixos/modules/system/boot/loader/grub/grub.nix @@ -277,7 +277,11 @@ in '') config.boot.loader.grub.extraFiles); assertions = [{ assertion = !cfg.zfsSupport || cfg.version == 2; - message = "Only grub version 2 provides zfs support";}]; + message = "Only grub version 2 provides zfs support";}] + ++ flip map cfg.devices (dev: { + assertion = hasPrefix "/" dev; + message = "Grub devices must be absolute paths, not ${dev}"; + }); })