From 1f74238a4c8e534a1b6be72cb5153043071ffd17 Mon Sep 17 00:00:00 2001 From: musjj <72612857+musjj@users.noreply.github.com> Date: Sun, 22 Dec 2024 19:55:36 +0700 Subject: [PATCH] xresources: allow floating point values --- modules/xresources.nix | 2 +- tests/modules/xresources/xresources-expected.conf | 1 + tests/modules/xresources/xresources.nix | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/xresources.nix b/modules/xresources.nix index cb8dae238..a2396e236 100644 --- a/modules/xresources.nix +++ b/modules/xresources.nix @@ -32,7 +32,7 @@ in { xresources.properties = mkOption { type = with types; let - prim = either bool (either int str); + prim = oneOf [ bool int float str ]; entry = either prim (listOf prim); in nullOr (attrsOf entry); default = null; diff --git a/tests/modules/xresources/xresources-expected.conf b/tests/modules/xresources/xresources-expected.conf index 20b47e508..577605d2a 100644 --- a/tests/modules/xresources/xresources-expected.conf +++ b/tests/modules/xresources/xresources-expected.conf @@ -1,5 +1,6 @@ Test*boolean1: true Test*boolean2: false +Test*float: 12.300000 Test*int: 10 Test*list: list-str, true, false, 10 Test*string: test-string diff --git a/tests/modules/xresources/xresources.nix b/tests/modules/xresources/xresources.nix index 36d092e0d..3f8a83678 100644 --- a/tests/modules/xresources/xresources.nix +++ b/tests/modules/xresources/xresources.nix @@ -7,6 +7,7 @@ "Test*boolean1" = true; "Test*boolean2" = false; "Test*int" = 10; + "Test*float" = 12.3; "Test*list" = [ "list-str" true false 10 ]; }; };