1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-28 04:39:48 +01: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
}
'')
''