mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-13 20:30:02 +00:00
defaults: move com.apple.smb.server to /activate
Currently fails with permission errors.
This commit is contained in:
parent
81bdd38e8d
commit
e3281c90cf
3 changed files with 29 additions and 17 deletions
|
@ -58,6 +58,7 @@ in
|
|||
${cfg.activationScripts.nix.text}
|
||||
${cfg.activationScripts.applications.text}
|
||||
${cfg.activationScripts.etc.text}
|
||||
${cfg.activationScripts.defaults.text}
|
||||
${cfg.activationScripts.launchd.text}
|
||||
${cfg.activationScripts.nix-daemon.text}
|
||||
${cfg.activationScripts.time.text}
|
||||
|
@ -96,7 +97,7 @@ in
|
|||
|
||||
${cfg.activationScripts.checks.text}
|
||||
${cfg.activationScripts.extraUserActivation.text}
|
||||
${cfg.activationScripts.defaults.text}
|
||||
${cfg.activationScripts.userDefaults.text}
|
||||
${cfg.activationScripts.userLaunchd.text}
|
||||
|
||||
${cfg.activationScripts.postUserActivation.text}
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.system.defaults;
|
||||
|
||||
isFloat = x: isString x && builtins.match "^[+-]?([0-9]*[.])?[0-9]+$" x != null;
|
||||
|
@ -30,26 +29,32 @@ let
|
|||
trackpad = defaultsToList "com.apple.AppleMultitouchTrackpad" cfg.trackpad;
|
||||
trackpadBluetooth = defaultsToList "com.apple.driver.AppleBluetoothMultitouch.trackpad" cfg.trackpad;
|
||||
|
||||
mkIfAttrs = list: mkIf (any (attrs: attrs != {}) list);
|
||||
in
|
||||
|
||||
{
|
||||
options = {
|
||||
};
|
||||
|
||||
config = {
|
||||
|
||||
system.activationScripts.defaults.text = ''
|
||||
# Set defaults
|
||||
echo "writing defaults..." >&2
|
||||
system.activationScripts.defaults.text = mkIfAttrs [ smb ]
|
||||
''
|
||||
# Set defaults
|
||||
echo >&2 "system defaults..."
|
||||
${concatStringsSep "\n" smb}
|
||||
'';
|
||||
|
||||
${concatStringsSep "\n" NSGlobalDomain}
|
||||
${concatStringsSep "\n" LaunchServices}
|
||||
${concatStringsSep "\n" dock}
|
||||
${concatStringsSep "\n" finder}
|
||||
${concatStringsSep "\n" smb}
|
||||
${concatStringsSep "\n" trackpad}
|
||||
${concatStringsSep "\n" trackpadBluetooth}
|
||||
'';
|
||||
system.activationScripts.userDefaults.text = mkIfAttrs
|
||||
[ NSGlobalDomain LaunchServices dock finder trackpad trackpadBluetooth ]
|
||||
''
|
||||
# Set defaults
|
||||
echo >&2 "user defaults..."
|
||||
|
||||
${concatStringsSep "\n" NSGlobalDomain}
|
||||
${concatStringsSep "\n" LaunchServices}
|
||||
${concatStringsSep "\n" dock}
|
||||
${concatStringsSep "\n" finder}
|
||||
${concatStringsSep "\n" trackpad}
|
||||
${concatStringsSep "\n" trackpadBluetooth}
|
||||
'';
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
@ -32,9 +32,15 @@
|
|||
system.defaults.NSGlobalDomain."com.apple.swipescrolldirection" = true;
|
||||
system.defaults.dock.autohide-delay = "0.24";
|
||||
system.defaults.dock.orientation = "left";
|
||||
system.defaults.smb.NetBIOSName = "IMAC-000000";
|
||||
system.defaults.smb.ServerDescription = ''Darwin\\\\U2019s iMac'';
|
||||
|
||||
test = ''
|
||||
echo checking defaults write in /activate-user >&2
|
||||
echo >&2 "checking defaults write in /activate"
|
||||
grep "defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server 'NetBIOSName' -string 'IMAC-000000'" ${config.out}/activate
|
||||
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 'AppleFontSmoothing' -int 1" ${config.out}/activate-user
|
||||
grep "defaults write -g 'AppleKeyboardUIMode' -int 3" ${config.out}/activate-user
|
||||
grep "defaults write -g 'ApplePressAndHoldEnabled' -bool YES" ${config.out}/activate-user
|
||||
|
|
Loading…
Add table
Reference in a new issue