From 1d8c5d9b79dba8ec20806701b711f49b0b07a6fe Mon Sep 17 00:00:00 2001 From: pjan vandaele Date: Mon, 1 Jan 2018 09:20:27 +0900 Subject: [PATCH] fix + tests --- modules/system/defaults-write.nix | 2 +- tests/system-defaults-write.nix | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/system/defaults-write.nix b/modules/system/defaults-write.nix index d69a2c3c..e5c2cddb 100644 --- a/modules/system/defaults-write.nix +++ b/modules/system/defaults-write.nix @@ -6,7 +6,7 @@ let cfg = config.system.defaults; - isFloat = x: isString x && builtins.match "^[+-]?([1-9]*[.])?[0-9]+$" x != null; + isFloat = x: isString x && builtins.match "^[+-]?([0-9]*[.])?[0-9]+$" x != null; boolValue = x: if x then "YES" else "NO"; diff --git a/tests/system-defaults-write.nix b/tests/system-defaults-write.nix index 3ba3ef5a..0a41a045 100644 --- a/tests/system-defaults-write.nix +++ b/tests/system-defaults-write.nix @@ -2,11 +2,13 @@ { system.defaults.NSGlobalDomain.KeyRepeat = 1; + system.defaults.dock.autohide-delay = "0.24"; system.defaults.dock.orientation = "left"; test = '' echo checking defaults write in /activate-user >&2 grep "defaults write -g 'KeyRepeat' -int 1" ${config.out}/activate-user grep "defaults write com.apple.dock 'orientation' -string 'left'" ${config.out}/activate-user + grep "defaults write com.apple.dock 'autohide-delay' -float 0.24" ${config.out}/activate-user ''; }