From cabf369f833af817f19b8ae11f15b91aed2121f3 Mon Sep 17 00:00:00 2001 From: colin Date: Wed, 1 Jun 2022 15:43:14 -0700 Subject: [PATCH 1/2] phosh: allow fractional scaling --- nixos/modules/services/x11/desktop-managers/phosh.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/x11/desktop-managers/phosh.nix b/nixos/modules/services/x11/desktop-managers/phosh.nix index 4bf78fa16e7d..68402ed160bd 100644 --- a/nixos/modules/services/x11/desktop-managers/phosh.nix +++ b/nixos/modules/services/x11/desktop-managers/phosh.nix @@ -78,7 +78,7 @@ let description = '' Display scaling factor. ''; - type = types.nullOr types.ints.unsigned; + type = types.nullOr (types.either types.ints.unsigned types.float); default = null; example = 2; }; From 1d0649f9296d909b7bcc83a3b36558a18177e5e3 Mon Sep 17 00:00:00 2001 From: colin Date: Thu, 2 Jun 2022 01:40:43 -0700 Subject: [PATCH 2/2] phosh: restrict the `scale` config value to strictly positive values or null --- nixos/modules/services/x11/desktop-managers/phosh.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/x11/desktop-managers/phosh.nix b/nixos/modules/services/x11/desktop-managers/phosh.nix index 68402ed160bd..5efe645d8aa2 100644 --- a/nixos/modules/services/x11/desktop-managers/phosh.nix +++ b/nixos/modules/services/x11/desktop-managers/phosh.nix @@ -78,7 +78,13 @@ let description = '' Display scaling factor. ''; - type = types.nullOr (types.either types.ints.unsigned types.float); + type = types.nullOr ( + types.addCheck + (types.either types.int types.float) + (x : x > 0) + ) // { + description = "null or positive integer or float"; + }; default = null; example = 2; };