diff --git a/modules/programs/kitty.nix b/modules/programs/kitty.nix index 627cc61f6..196ecbdbd 100644 --- a/modules/programs/kitty.nix +++ b/modules/programs/kitty.nix @@ -133,28 +133,25 @@ in { text = '' # Generated by Home Manager. # See https://sw.kovidgoyal.net/kitty/conf.html + '' + concatStringsSep "\n" ([ - ${optionalString (cfg.font != null) '' + (optionalString (cfg.font != null) '' font_family ${cfg.font.name} ${optionalString (cfg.font.size != null) "font_size ${toString cfg.font.size}"} - ''} + '') - ${optionalString (cfg.theme != null) '' + (optionalString (cfg.theme != null) '' include ${pkgs.kitty-themes}/${ (head (filter (x: x.name == cfg.theme) (builtins.fromJSON (builtins.readFile "${pkgs.kitty-themes}/themes.json")))).file } - ''} - - ${toKittyConfig cfg.settings} - - ${toKittyKeybindings cfg.keybindings} - - ${toKittyEnv cfg.environment} - - ${cfg.extraConfig} - ''; + '') + (toKittyConfig cfg.settings) + (toKittyKeybindings cfg.keybindings) + (toKittyEnv cfg.environment) + cfg.extraConfig + ]); } // optionalAttrs pkgs.stdenv.hostPlatform.isLinux { onChange = '' ${pkgs.procps}/bin/pkill -USR1 -u $USER kitty || true diff --git a/tests/modules/programs/kitty/example-settings-expected.conf b/tests/modules/programs/kitty/example-settings-expected.conf index 8d0fbd14a..31d2fdc12 100644 --- a/tests/modules/programs/kitty/example-settings-expected.conf +++ b/tests/modules/programs/kitty/example-settings-expected.conf @@ -1,22 +1,15 @@ # Generated by Home Manager. # See https://sw.kovidgoyal.net/kitty/conf.html - font_family DejaVu Sans font_size 8 - - enable_audio_bell no scrollback_lines 10000 update_check_interval 0 - map ctrl+c copy_or_interrupt map ctrl+f>2 set_font_size 20 - env LS_COLORS=1 - -