diff --git a/modules/programs/kitty.nix b/modules/programs/kitty.nix index d9a3081d..698e8034 100644 --- a/modules/programs/kitty.nix +++ b/modules/programs/kitty.nix @@ -186,9 +186,13 @@ in { (optionalString (cfg.theme != null) '' include ${pkgs.kitty-themes}/share/kitty-themes/${ - (head (filter (x: x.name == cfg.theme) (builtins.fromJSON - (builtins.readFile - "${pkgs.kitty-themes}/share/kitty-themes/themes.json")))).file + let + matching = filter (x: x.name == cfg.theme) (builtins.fromJSON + (builtins.readFile + "${pkgs.kitty-themes}/share/kitty-themes/themes.json")); + in throwIf (length matching == 0) + "kitty-themes does not contain a theme named ${cfg.theme}" + (head matching).file } '') ''