Skip to content

Commit

Permalink
Merge pull request #838 from moni-dz/deprecate-string-float
Browse files Browse the repository at this point in the history
Use native floats for mouse scaling
  • Loading branch information
Enzime authored Dec 27, 2023
2 parents f454cff + 9acb5b1 commit 8a83212
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions modules/system/defaults/GlobalPreferences.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {

Expand All @@ -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.
Expand Down

0 comments on commit 8a83212

Please sign in to comment.