1
1
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-08-16 16:10:39 +03:00

feat(screensaver): add support of askForPassword and askForPasswordDelay

This commit is contained in:
Julien Brochet 2023-04-23 14:11:44 +02:00
parent 379d42fad6
commit 2303eed571
No known key found for this signature in database
GPG Key ID: DC5773ACC2B9ABA3
4 changed files with 32 additions and 0 deletions

View File

@ -19,6 +19,7 @@
./system/defaults/dock.nix
./system/defaults/finder.nix
./system/defaults/screencapture.nix
./system/defaults/screensaver.nix
./system/defaults/alf.nix
./system/defaults/loginwindow.nix
./system/defaults/magicmouse.nix

View File

@ -34,6 +34,7 @@ let
magicmouse = defaultsToList "com.apple.AppleMultitouchMouse" cfg.magicmouse;
magicmouseBluetooth = defaultsToList "com.apple.driver.AppleMultitouchMouse.mouse" cfg.magicmouse;
screencapture = defaultsToList "com.apple.screencapture" cfg.screencapture;
screensaver = defaultsToList "com.apple.screensaver" cfg.screensaver;
spaces = defaultsToList "com.apple.spaces" cfg.spaces;
trackpad = defaultsToList "com.apple.AppleMultitouchTrackpad" cfg.trackpad;
trackpadBluetooth = defaultsToList "com.apple.driver.AppleBluetoothMultitouch.trackpad" cfg.trackpad;
@ -84,6 +85,7 @@ in
magicmouse
magicmouseBluetooth
screencapture
screensaver
spaces
trackpad
trackpadBluetooth
@ -104,6 +106,7 @@ in
${concatStringsSep "\n" magicmouse}
${concatStringsSep "\n" magicmouseBluetooth}
${concatStringsSep "\n" screencapture}
${concatStringsSep "\n" screensaver}
${concatStringsSep "\n" spaces}
${concatStringsSep "\n" trackpad}
${concatStringsSep "\n" trackpadBluetooth}

View File

@ -0,0 +1,24 @@
{ config, lib, ... }:
with lib;
{
options = {
system.defaults.screensaver.askForPassword = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
If true, the user is prompted for a password when the screen saver is unlocked or stopped. The default is false.
'';
};
system.defaults.screensaver.askForPasswordDelay = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
The number of seconds to delay before the password will be required to unlock or stop the screen saver (the grace period).
'';
};
};
}

View File

@ -41,6 +41,8 @@
system.defaults.dock.autohide-delay = 0.24;
system.defaults.dock.orientation = "left";
system.defaults.screencapture.location = "/tmp";
system.defaults.screensaver.askForPassword = true;
system.defaults.screensaver.askForPasswordDelay = 5;
system.defaults.smb.NetBIOSName = "IMAC-000000";
system.defaults.smb.ServerDescription = ''Darwin\\\\U2019s iMac'';
system.defaults.universalaccess.reduceTransparency = true;
@ -104,6 +106,8 @@
grep "defaults write com.apple.dock 'appswitcher-all-displays' -bool NO" ${config.out}/activate-user
grep "defaults write com.apple.dock 'orientation' -string 'left'" ${config.out}/activate-user
grep "defaults write com.apple.screencapture 'location' -string '/tmp'" ${config.out}/activate-user
grep "defaults write com.apple.screensaver 'askForPassword' -bool YES" ${config.out}/activate-user
grep "defaults write com.apple.screensaver 'askForPasswordDelay' -int 5" ${config.out}/activate-user
grep "defaults write com.apple.universalaccess 'reduceTransparency' -bool YES" ${config.out}/activate-user
grep "defaults write com.apple.universalaccess 'closeViewScrollWheelToggle' -bool YES" ${config.out}/activate-user
grep "defaults write com.apple.universalaccess 'closeViewZoomFollowsFocus' -bool YES" ${config.out}/activate-user