(mirror) personal dotfiles
github.com/crescentrose/dotfiles
1{ pkgs, ... }:
2let
3 # Another joy of the corporate life: your full legal name as the device
4 # user...
5 user = "ivan.ostric";
6in
7{
8 system.primaryUser = user;
9
10 environment.systemPackages = with pkgs; [
11 # macOS-specific Docker stuff
12 podman
13 docker # use `docker` commands with podman
14 docker-buildx
15 ];
16
17 # Ideally we would manage everything with Nix, but life is sad and some
18 # packages are only available through Brew.
19 #
20 # Note that Homebrew needs to be installed manually for this to work.
21 homebrew = {
22 enable = true;
23 brews = [
24 "helm"
25 # Install apps from the Mac App Store through CLI
26 "mas"
27 # Install Vault through Hashicorp's tap
28 "hashicorp/tap/vault"
29 # Install Terraform through Hashicorp's tap
30 "hashicorp/tap/terraform"
31 # Install Docker credential helpers
32 "docker-credential-helper"
33 # Set up a development database
34 {
35 name = "postgresql@18";
36 restart_service = true;
37 link = true;
38 conflicts_with = [ "postgresql" ];
39 }
40 ];
41 taps = [ "hashicorp/tap" ];
42 casks = [
43 "1password"
44 "1password-cli"
45 "ghostty"
46 "obsidian"
47 "podman-desktop"
48 "raycast"
49 "font-cascadia-code-nf"
50 "font-fira-code-nerd-font"
51 "font-symbols-only-nerd-font"
52 "font-maple-mono"
53 "zed"
54 ];
55 };
56
57 # System configuration
58 system.defaults = {
59 # Automatic dark/light mode switch
60 NSGlobalDomain.AppleInterfaceStyleSwitchesAutomatically = true;
61
62 # Disable automatic predictive text
63 NSGlobalDomain.NSAutomaticInlinePredictionEnabled = false;
64
65 # Use F1, F2, ... keys as standard function keys
66 NSGlobalDomain."com.apple.keyboard.fnState" = true;
67
68 # Enable tap-to-click
69 NSGlobalDomain."com.apple.mouse.tapBehavior" = 1;
70
71 # Auto hide the Dock
72 dock.autohide = true;
73
74 # Do not show recent apps in the Dock
75 dock.show-recents = false;
76
77 # When opening a new Finder window, take me to my home directory rather
78 # than Recents.
79 finder.NewWindowTarget = "Home";
80
81 # Switch between languages on Globe key.
82 hitoolbox.AppleFnUsageType = "Change Input Source";
83 };
84
85 system.keyboard.enableKeyMapping = true;
86 system.keyboard.remapCapsLockToControl = true;
87
88 # Use ZSH as the main shell
89 programs.zsh.enable = true;
90 # Use Homebrew through zsh
91 programs.zsh.shellInit = ''
92 eval "$(/opt/homebrew/bin/brew shellenv)"
93 '';
94
95 # Use Touch ID for authentication with `sudo`
96 security.pam.services.sudo_local.touchIdAuth = true;
97
98 # Using Determinate Nix, because upstream Nix does not work as well when
99 # your corporate provisioned device is loaded with Microsoft endpoint
100 # security "features"
101 nix.enable = false;
102 nixpkgs.hostPlatform = "aarch64-darwin";
103
104 users.users."${user}" = {
105 name = user;
106 home = "/Users/${user}";
107 };
108
109 # WARN: Here be dragons!
110 system.stateVersion = 6;
111}