summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorfortuneteller2k <lythe1107@gmail.com>2023-12-27 11:30:04 +0800
committerfortuneteller2k <lythe1107@gmail.com>2023-12-27 11:30:04 +0800
commit9acb5b1adc50d29aa18dc4323bc4b63b05fdb59f (patch)
treef3c1d5b33f061c44b3c946bf0c3ced8285ae7445 /modules
parentf454cff5fe84adca9e8aa8d546d2c9879b789950 (diff)
Use native floats for mouse scaling
Diffstat (limited to 'modules')
-rw-r--r--modules/system/defaults/GlobalPreferences.nix13
1 files changed, 3 insertions, 10 deletions
diff --git a/modules/system/defaults/GlobalPreferences.nix b/modules/system/defaults/GlobalPreferences.nix
index e6964aa..32841be 100644
--- a/modules/system/defaults/GlobalPreferences.nix
+++ b/modules/system/defaults/GlobalPreferences.nix
@@ -3,15 +3,7 @@
with lib;
let
- isFloat = x: isString x && builtins.match "^[+-]?([0-9]*[.])?[0-9]+$" x != null;
-
- float = mkOptionType {
- name = "float";
- description = "float";
- check = isFloat;
- merge = options.mergeOneOption;
- };
-
+ inherit (config.lib.defaults.types) floatWithDeprecationError;
in {
options = {
@@ -28,8 +20,9 @@ in {
system.defaults.".GlobalPreferences"."com.apple.mouse.scaling" =
mkOption {
- type = types.nullOr float;
+ type = types.nullOr floatWithDeprecationError;
default = null;
+ example = -1;
description = lib.mdDoc ''
Sets the mouse tracking speed. Found in the "Mouse" section of
"System Preferences". Set to -1 to disable mouse acceleration.