{ config, lib, pkgs, ... }: with lib; let # Extract the set-environment path that nix-darwin generates setEnvironmentPath = "${config.system.build.setEnvironment}"; in { imports = [ ./common.nix ]; config = { # Salt manages /etc/bashrc, /etc/zshrc, /etc/zshenv # nix-darwin writes to .local variants for nix-specific configuration # Disable nix-darwin from managing the main shell files environment.etc."bashrc".enable = false; environment.etc."zshrc".enable = false; environment.etc."zshenv".enable = false; environment.etc."zprofile".enable = false; # Create .local files with nix environment setup environment.etc."bash.local".text = '' # Nix environment setup if [ -z "$__NIX_DARWIN_SET_ENVIRONMENT_DONE" ]; then . ${setEnvironmentPath} fi ''; environment.etc."zshrc.local".text = '' # Nix environment setup (already done in zshenv.local) ''; environment.etc."zshenv.local".text = '' # Nix environment setup if [[ -o rcs ]]; then if [ -z "''${__NIX_DARWIN_SET_ENVIRONMENT_DONE-}" ]; then . ${setEnvironmentPath} fi # Tell zsh how to find installed completions for p in ''${(z)NIX_PROFILES}; do fpath=($p/share/zsh/site-functions $p/share/zsh/$ZSH_VERSION/functions $p/share/zsh/vendor-completions $fpath) done fi ''; # System preferences system.defaults = { # Custom keyboard shortcuts CustomUserPreferences = { "com.apple.symbolichotkeys" = { AppleSymbolicHotKeys = { # Screenshot - Capture entire screen (Cmd+Ctrl+3) "28" = { enabled = true; value = { parameters = [ 51 20 1310720 ]; type = "standard"; }; }; # Screenshot - Capture selected portion (Cmd+Ctrl+4) "30" = { enabled = true; value = { parameters = [ 52 21 1310720 ]; type = "standard"; }; }; # Screenshot - Show screenshot toolbar (Cmd+Ctrl+5) "184" = { enabled = true; value = { parameters = [ 53 23 1310720 ]; type = "standard"; }; }; }; }; }; }; }; }