mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 05:29:46 +01:00
kitty: improve error message when theme not found (#3989)
This commit is contained in:
parent
6702b22b98
commit
db3d440e26
1 changed files with 7 additions and 3 deletions
|
@ -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
|
||||
}
|
||||
'')
|
||||
''
|
||||
|
|
Loading…
Reference in a new issue