diff options
| author | Daiderd Jordan <daiderd@gmail.com> | 2019-09-01 09:58:01 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-01 09:58:01 +0200 |
| commit | be7f25b3f9b1a72e41f16f82344dbfbe0b48f39f (patch) | |
| tree | 81779c02580e60efa6e1b179dac9b4fb3320c6e5 /modules/system | |
| parent | eb2812d669e4ca12647629428a8826884c0202d2 (diff) | |
| parent | 88d27c62d5b754f30abd73cb3aff7287c6d753ad (diff) | |
Merge pull request #155 from toonn/defaults-write-GlobalPreferences
Add defaults write for the alert sound
Diffstat (limited to 'modules/system')
| -rw-r--r-- | modules/system/defaults-write.nix | 4 | ||||
| -rw-r--r-- | modules/system/defaults/GlobalPreferences.nix | 20 |
2 files changed, 23 insertions, 1 deletions
diff --git a/modules/system/defaults-write.nix b/modules/system/defaults-write.nix index 80ffb08..889400b 100644 --- a/modules/system/defaults-write.nix +++ b/modules/system/defaults-write.nix @@ -22,6 +22,7 @@ let defaultsToList = domain: attrs: mapAttrsToList (writeDefault domain) (filterAttrs (n: v: v != null) attrs); NSGlobalDomain = defaultsToList "-g" cfg.NSGlobalDomain; + GlobalPreferences = defaultsToList ".GlobalPreferences" cfg.".GlobalPreferences"; LaunchServices = defaultsToList "com.apple.LaunchServices" cfg.LaunchServices; dock = defaultsToList "com.apple.dock" cfg.dock; finder = defaultsToList "com.apple.finder" cfg.finder; @@ -44,12 +45,13 @@ in ''; system.activationScripts.userDefaults.text = mkIfAttrs - [ NSGlobalDomain LaunchServices dock finder screencapture trackpad trackpadBluetooth ] + [ NSGlobalDomain GlobalPreferences LaunchServices dock finder screencapture trackpad trackpadBluetooth ] '' # Set defaults echo >&2 "user defaults..." ${concatStringsSep "\n" NSGlobalDomain} + ${concatStringsSep "\n" GlobalPreferences} ${concatStringsSep "\n" LaunchServices} ${concatStringsSep "\n" dock} ${concatStringsSep "\n" finder} diff --git a/modules/system/defaults/GlobalPreferences.nix b/modules/system/defaults/GlobalPreferences.nix new file mode 100644 index 0000000..935a8f2 --- /dev/null +++ b/modules/system/defaults/GlobalPreferences.nix @@ -0,0 +1,20 @@ +{ config, lib, ... }: + +with lib; + +{ + options = { + + system.defaults.".GlobalPreferences"."com.apple.sound.beep.sound" = + mkOption { + type = types.nullOr (types.path); + default = null; + description = '' + Sets the system-wide alert sound. Found under "Sound Effects" in the + "Sound" section of "System Preferences". Look in + "/System/Library/Sounds" for possible candidates. + ''; + }; + + }; +} |
