1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-13 18:23:39 +02:00

kitty: improve error message when theme not found (#3989)

This commit is contained in:
Naïm Favier 2023-05-14 12:05:10 +02:00 committed by GitHub
parent 6702b22b98
commit db3d440e26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}
'')
''