|
| 1 | +{ config, pkgs, ... }: |
| 2 | + |
| 3 | +{ |
| 4 | + # Auto upgrade nix package and the daemon service. |
| 5 | + services = { |
| 6 | + nix-daemon = { |
| 7 | + enable = true; |
| 8 | + }; |
| 9 | + }; |
| 10 | + |
| 11 | + nix = { |
| 12 | + package = pkgs.nix; |
| 13 | + settings = { |
| 14 | + "extra-experimental-features" = [ "nix-command" "flakes" ]; |
| 15 | + }; |
| 16 | + }; |
| 17 | + |
| 18 | + nixpkgs = { |
| 19 | + config = { |
| 20 | + allowUnfree = true; # VSCode, ... |
| 21 | + }; |
| 22 | + }; |
| 23 | + |
| 24 | + programs = { |
| 25 | + zsh = { |
| 26 | + # Create /etc/zshrc that loads the nix-darwin environment. |
| 27 | + # Very important. Only once this is activated do you get a shell with everything set up. |
| 28 | + enable = true; |
| 29 | + }; |
| 30 | + |
| 31 | + bash = { |
| 32 | + # Some tools might have `/bin/bash` hard-coded, so help get Nix into those. |
| 33 | + enable = true; |
| 34 | + }; |
| 35 | + }; |
| 36 | + |
| 37 | + fonts = { |
| 38 | + fontDir.enable = true; |
| 39 | + |
| 40 | + fonts = [ |
| 41 | + (pkgs.nerdfonts.override { |
| 42 | + fonts = [ |
| 43 | + "FiraCode" |
| 44 | + ]; |
| 45 | + }) |
| 46 | + ]; |
| 47 | + }; |
| 48 | + |
| 49 | + homebrew = { |
| 50 | + enable = true; |
| 51 | + |
| 52 | + casks = [ |
| 53 | + "calibre" |
| 54 | + "discord" |
| 55 | + "docker" |
| 56 | + "firefox" |
| 57 | + "google-chrome" |
| 58 | + "joplin" |
| 59 | + "linearmouse" |
| 60 | + "nextcloud" |
| 61 | + "raycast" |
| 62 | + "signal" |
| 63 | + "vlc" |
| 64 | + ]; |
| 65 | + |
| 66 | + masApps = { |
| 67 | + # These are all special snowflakes, and installation might fail here for various |
| 68 | + # reasons which can only be resolved in the App Store GUI. It's still convenient |
| 69 | + # to have them listed here for reference, and guaranteeing their installation. |
| 70 | + "Wireguard" = 1451685025; |
| 71 | + "Telegram" = 747648890; |
| 72 | + }; |
| 73 | + }; |
| 74 | + |
| 75 | + system = { |
| 76 | + # Used for backwards compatibility, please read the changelog before changing. |
| 77 | + # $ darwin-rebuild changelog |
| 78 | + stateVersion = 4; |
| 79 | + |
| 80 | + activationScripts = { |
| 81 | + postUserActivation = { |
| 82 | + # https://medium.com/@zmre/nix-darwin-quick-tip-activate-your-preferences-f69942a93236 |
| 83 | + text = "/System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings - u"; |
| 84 | + }; |
| 85 | + }; |
| 86 | + |
| 87 | + defaults = { |
| 88 | + dock = { |
| 89 | + autohide = true; |
| 90 | + orientation = "left"; |
| 91 | + show-process-indicators = false; |
| 92 | + show-recents = false; |
| 93 | + static-only = true; |
| 94 | + }; |
| 95 | + finder = { |
| 96 | + AppleShowAllExtensions = true; |
| 97 | + AppleShowAllFiles = true; |
| 98 | + FXEnableExtensionChangeWarning = false; |
| 99 | + ShowPathbar = true; |
| 100 | + ShowStatusBar = true; |
| 101 | + _FXShowPosixPathInTitle = true; |
| 102 | + }; |
| 103 | + NSGlobalDomain = { |
| 104 | + AppleFontSmoothing = 0; # https://www.reddit.com/r/apple/comments/t9qdl1/comment/hzvyq2g/ |
| 105 | + InitialKeyRepeat = 15; # Delay before keys are repeated |
| 106 | + KeyRepeat = 2; # Delay between repeated keystrokes when holding down |
| 107 | + }; |
| 108 | + }; |
| 109 | + }; |
| 110 | +} |
0 commit comments