default.nix (4089B) - Raw
1 { 2 config, 3 lib, 4 pkgs, 5 ... 6 }: 7 let 8 cfg = config.mj; 9 in 10 { 11 imports = [ ../base ]; 12 13 config = { 14 nix.gc.interval = { 15 Weekday = 0; 16 Hour = 2; 17 Minute = 0; 18 }; 19 20 users.users.${cfg.username}.home = "/Users/${cfg.username}"; 21 22 system = { 23 primaryUser = cfg.username; 24 keyboard = { 25 enableKeyMapping = true; 26 nonUS.remapTilde = true; 27 }; 28 29 defaults = { 30 dock = { 31 autohide-time-modifier = 0.0; 32 autohide-delay = 0.0; 33 expose-animation-duration = 0.0; 34 launchanim = false; 35 mineffect = "scale"; 36 }; 37 38 NSGlobalDomain = { 39 NSAutomaticWindowAnimationsEnabled = false; 40 NSScrollAnimationEnabled = false; 41 NSWindowResizeTime = 0.001; 42 "com.apple.swipescrolldirection" = false; 43 NSWindowShouldDragOnGesture = true; 44 }; 45 46 screensaver.askForPassword = true; 47 screensaver.askForPasswordDelay = 0; 48 49 menuExtraClock.ShowSeconds = true; 50 # Show24Hour, ShowDate, DateFormat are ignored by macOS Tahoe; 51 # set manually in System Settings > Control Center > Clock Options. 52 53 CustomUserPreferences."com.apple.symbolichotkeys" = 54 let 55 selectPreviousInputSource = "60"; 56 shift = 131072; 57 option = 524288; # Alt 58 spaceAscii = 32; 59 spaceVirtualKey = 49; 60 in 61 { 62 AppleSymbolicHotKeys = { 63 ${selectPreviousInputSource} = { 64 enabled = true; 65 value = { 66 parameters = [ 67 spaceAscii 68 spaceVirtualKey 69 (shift + option) 70 ]; 71 type = "standard"; 72 }; 73 }; 74 }; 75 }; 76 77 CustomUserPreferences."com.apple.HIToolbox" = { 78 AppleEnabledInputSources = [ 79 { 80 InputSourceKind = "Keyboard Layout"; 81 "KeyboardLayout ID" = 0; 82 "KeyboardLayout Name" = "U.S."; 83 } 84 { 85 InputSourceKind = "Keyboard Layout"; 86 "KeyboardLayout ID" = 30; 87 "KeyboardLayout Name" = "Lithuanian"; 88 } 89 ]; 90 }; 91 }; 92 }; 93 94 programs = { 95 bash = { 96 enable = true; 97 interactiveShellInit = '' 98 # Provide a nice prompt if the terminal supports it. 99 if [ "$TERM" != "dumb" ] || [ -n "$INSIDE_EMACS" ]; then 100 PROMPT_COLOR="1;31m" 101 ((UID)) && PROMPT_COLOR="1;32m" 102 if [ -n "$INSIDE_EMACS" ]; then 103 PS1="\n\[\033[$PROMPT_COLOR\][\u@\h:\w]\\$\[\033[0m\] " 104 else 105 PS1="\n\[\033[$PROMPT_COLOR\][\u@\h:\w]\\$\[\033[0m\] " 106 if [[ "$TERM" =~ xterm ]]; then 107 PS1="\[\033]0;\u@\h: \w\007\]$PS1" 108 fi 109 fi 110 fi 111 ''; 112 }; 113 114 zsh.enable = lib.mkForce false; 115 }; 116 environment = { 117 shells = [ pkgs.bash ]; 118 119 systemPackages = with pkgs; [ 120 gnutar 121 (writeShellScriptBin "gtar" ''exec ${gnutar}/bin/tar "$@"'') 122 watch 123 ]; 124 }; 125 126 system.activationScripts.postActivation.text = '' 127 dscl . -create /Users/${cfg.username} UserShell /run/current-system/sw/bin/bash 128 ''; 129 130 home-manager = { 131 useGlobalPkgs = true; 132 backupFileExtension = "bk"; 133 users.${cfg.username} = { 134 imports = [ ../../shared/home ]; 135 home = { 136 inherit (cfg) stateVersion username; 137 homeDirectory = "/Users/${cfg.username}"; 138 }; 139 targets.darwin.copyApps.enable = false; 140 targets.darwin.linkApps.enable = true; 141 programs.ssh = { 142 enable = true; 143 enableDefaultConfig = false; 144 matchBlocks."*" = { 145 identityFile = [ "~/.ssh/id_ed25519" ]; 146 extraOptions = { 147 AddKeysToAgent = "yes"; 148 UseKeychain = "yes"; 149 }; 150 }; 151 }; 152 }; 153 }; 154 }; 155 }