From fcf5e608ac65f64463bc0ccc5ea86f2170f20689 Mon Sep 17 00:00:00 2001 From: MithicSpirit Date: Mon, 7 Oct 2024 06:18:19 -0400 Subject: [PATCH] kitty: allow float values in settings (#5925) Some settings in kitty allow floating-point values, but this was not reflected in the type. --- modules/programs/kitty.nix | 4 ++-- tests/modules/programs/kitty/example-settings-expected.conf | 1 + tests/modules/programs/kitty/example-settings.nix | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/programs/kitty.nix b/modules/programs/kitty.nix index e9594ec12..9854fe69c 100644 --- a/modules/programs/kitty.nix +++ b/modules/programs/kitty.nix @@ -5,7 +5,7 @@ with lib; let cfg = config.programs.kitty; - eitherStrBoolInt = with types; either str (either bool int); + settingsValueType = with types; oneOf [ str bool int float ]; optionalPackage = opt: optional (opt != null && opt.package != null) opt.package; @@ -102,7 +102,7 @@ in { }; settings = mkOption { - type = types.attrsOf eitherStrBoolInt; + type = types.attrsOf settingsValueType; default = { }; example = literalExpression '' { diff --git a/tests/modules/programs/kitty/example-settings-expected.conf b/tests/modules/programs/kitty/example-settings-expected.conf index aca1b0c18..41a9cb772 100644 --- a/tests/modules/programs/kitty/example-settings-expected.conf +++ b/tests/modules/programs/kitty/example-settings-expected.conf @@ -7,6 +7,7 @@ font_size 8 # Shell integration is sourced and configured manually shell_integration no-rc +background_opacity 0.500000 enable_audio_bell no scrollback_lines 10000 update_check_interval 0 diff --git a/tests/modules/programs/kitty/example-settings.nix b/tests/modules/programs/kitty/example-settings.nix index 8d609a5ab..8f2e0b894 100644 --- a/tests/modules/programs/kitty/example-settings.nix +++ b/tests/modules/programs/kitty/example-settings.nix @@ -17,6 +17,7 @@ with lib; scrollback_lines = 10000; enable_audio_bell = false; update_check_interval = 0; + background_opacity = 0.5; }; font.name = "DejaVu Sans";