summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Yang <dsyang92@gmail.com>2022-03-10 18:24:26 -0800
committerDan Yang <dsyang92@gmail.com>2022-03-14 10:04:28 -0700
commit37e42a9fe4d7460685f3bae8d694ec8a04dcbefe (patch)
treefbb274fe69f0fa4be1f67998175a3b46b0f75cba
parentd61d8b3bd039345ee0f820079b1c915e7a8a018b (diff)
add option to show hidden files everywhere
-rw-r--r--modules/system/defaults/NSGlobalDomain.nix8
-rw-r--r--tests/system-defaults-write.nix2
2 files changed, 10 insertions, 0 deletions
diff --git a/modules/system/defaults/NSGlobalDomain.nix b/modules/system/defaults/NSGlobalDomain.nix
index 2d2e54d..5fb329e 100644
--- a/modules/system/defaults/NSGlobalDomain.nix
+++ b/modules/system/defaults/NSGlobalDomain.nix
@@ -15,6 +15,14 @@ let
in {
options = {
+ system.defaults.NSGlobalDomain.AppleShowAllFiles = mkOption {
+ type = types.nullOr types.bool;
+ default = null;
+ description = ''
+ Whether to always show hidden files. The default is false.
+ '';
+ };
+
system.defaults.NSGlobalDomain.AppleEnableMouseSwipeNavigateWithScrolls = mkOption {
type = types.nullOr types.bool;
default = null;
diff --git a/tests/system-defaults-write.nix b/tests/system-defaults-write.nix
index 414b903..597e032 100644
--- a/tests/system-defaults-write.nix
+++ b/tests/system-defaults-write.nix
@@ -1,6 +1,7 @@
{ config, pkgs, ... }:
{
+ system.defaults.NSGlobalDomain.AppleShowAllFiles = true;
system.defaults.NSGlobalDomain.AppleEnableMouseSwipeNavigateWithScrolls = false;
system.defaults.NSGlobalDomain.AppleEnableSwipeNavigateWithScrolls = false;
system.defaults.NSGlobalDomain.AppleFontSmoothing = 1;
@@ -49,6 +50,7 @@
grep "defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server 'ServerDescription' -string 'Darwin.*s iMac'" ${config.out}/activate
echo >&2 "checking defaults write in /activate-user"
+ grep "defaults write -g 'AppleShowAllFiles' -bool YES" ${config.out}/activate-user
grep "defaults write -g 'AppleEnableMouseSwipeNavigateWithScrolls' -bool NO" ${config.out}/activate-user
grep "defaults write -g 'AppleEnableSwipeNavigateWithScrolls' -bool NO" ${config.out}/activate-user
grep "defaults write -g 'AppleFontSmoothing' -int 1" ${config.out}/activate-user