From 726dd9804ef249d8d20832e37b9e52caf340c534 Mon Sep 17 00:00:00 2001 From: WORLDofPEACE Date: Mon, 22 Feb 2021 07:35:00 -0500 Subject: [PATCH] nixos/plymouth: exit on missing theme Much better to provide a helpful message than to get an obscure sed message. --- nixos/modules/system/boot/plymouth.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nixos/modules/system/boot/plymouth.nix b/nixos/modules/system/boot/plymouth.nix index f16ff26a672..554e8bf375d 100644 --- a/nixos/modules/system/boot/plymouth.nix +++ b/nixos/modules/system/boot/plymouth.nix @@ -118,6 +118,12 @@ in copy_bin_and_libs ${pkgs.plymouth}/bin/plymouthd copy_bin_and_libs ${pkgs.plymouth}/bin/plymouth + # Check if the actual requested theme is here + if [[ ! -d ${themesEnv}/share/plymouth/themes/${cfg.theme} ]]; then + echo "The requested theme: ${cfg.theme} is not provided by any of the packages in boot.plymouth.themePackages" + exit 1 + fi + moduleName="$(sed -n 's,ModuleName *= *,,p' ${themesEnv}/share/plymouth/themes/${cfg.theme}/${cfg.theme}.plymouth)" mkdir -p $out/lib/plymouth/renderers