From 37e42a9fe4d7460685f3bae8d694ec8a04dcbefe Mon Sep 17 00:00:00 2001 From: Dan Yang Date: Thu, 10 Mar 2022 18:24:26 -0800 Subject: [PATCH] add option to show hidden files everywhere --- modules/system/defaults/NSGlobalDomain.nix | 8 ++++++++ tests/system-defaults-write.nix | 2 ++ 2 files changed, 10 insertions(+) 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