From 2e600f579621aacfce084057e0d80b97f9949080 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Fri, 3 Jan 2025 23:09:12 +0100 Subject: [PATCH] lib/options: add defaultNullOpts.mkProportion --- lib/options.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/options.nix b/lib/options.nix index 4cc16dac..bc115eda 100644 --- a/lib/options.nix +++ b/lib/options.nix @@ -167,6 +167,8 @@ rec { mkNum' = args: mkNullableWithRaw' (args // { type = types.number; }); mkNum = pluginDefault: description: mkNum' { inherit pluginDefault description; }; + mkProportion' = args: mkNullableWithRaw' (args // { type = types.numbers.between 0.0 1.0; }); + mkProportion = pluginDefault: description: mkProportion' { inherit pluginDefault description; }; mkInt' = args: mkNullableWithRaw' (args // { type = types.int; }); mkInt = pluginDefault: description: mkNum' { inherit pluginDefault description; }; # Positive: >0