Kieran's opinionated (and probably slightly dumb) nix config
1{
2 inputs,
3 pkgs,
4 ...
5}:
6{
7 imports = [
8 ./home-manager.nix
9 ];
10
11 # Set host platform for Apple Silicon
12 nixpkgs = {
13 hostPlatform = "aarch64-darwin";
14 config = {
15 allowUnfree = true;
16 };
17 };
18
19 # Enable nix-darwin
20 nix.settings.experimental-features = [
21 "nix-command"
22 "flakes"
23 ];
24
25 # switch to lix
26 nix.package = pkgs.lixPackageSets.stable.lix;
27
28 # Set hostname
29 networking.hostName = "atalanta";
30
31 # Define user
32 users.users.kierank = {
33 name = "kierank";
34 home = "/Users/kierank";
35 };
36
37 system.primaryUser = "kierank";
38
39 ids.gids.nixbld = 350;
40
41 # Install packages
42 environment.systemPackages = [
43 # nix stuff
44 pkgs.nixd
45 pkgs.nil
46 pkgs.nixfmt-rfc-style
47 inputs.agenix.packages.aarch64-darwin.default
48 # dev_langs
49 pkgs.nodejs_22
50 pkgs.unstable.bun
51 pkgs.python3
52 pkgs.go
53 pkgs.gopls
54 pkgs.gotools
55 pkgs.go-tools
56 pkgs.gcc
57 pkgs.rustc
58 pkgs.cargo
59 pkgs.jdk23
60 pkgs.ruby
61 pkgs.cmake
62 pkgs.unstable.biome
63 pkgs.unstable.apktool
64 pkgs.nodePackages_latest.prisma
65 pkgs.unstable.zola
66 pkgs.mill
67 pkgs.clang
68 pkgs.clang-tools
69 pkgs.ninja
70 # tools
71 pkgs.calc
72 pkgs.nh
73 pkgs.rustscan
74 pkgs.vhs
75 inputs.soapdump.packages.${pkgs.system}.default
76 ];
77
78 programs.direnv.enable = true;
79
80 # import the secret
81 age.identityPaths = [
82 "/Users/kierank/.ssh/id_rsa"
83 ];
84 age.secrets = {
85 wakatime = {
86 file = ../../secrets/wakatime.age;
87 path = "/Users/kierank/.wakatime.cfg";
88 owner = "kierank";
89 };
90 bluesky = {
91 file = ../../secrets/bluesky.age;
92 owner = "kierank";
93 };
94 crush = {
95 file = ../../secrets/crush.age;
96 owner = "kierank";
97 };
98 context7 = {
99 file = ../../secrets/context7.age;
100 owner = "kierank";
101 };
102 };
103
104 environment.variables = {
105 EDITOR = "nvim";
106 SYSTEMD_EDITOR = "nvim";
107 VISUAL = "nvim";
108 };
109
110 # nothing but finder in the doc
111 system.defaults.dock = {
112 persistent-apps = [ ];
113
114 tilesize = 47;
115 show-recents = false;
116 };
117
118 # allow using apple watch or touch id for sudo
119 security.pam.services.sudo_local.touchIdAuth = true;
120 security.pam.services.sudo_local.watchIdAuth = true;
121
122 system.defaults = {
123 finder.FXPreferredViewStyle = "Nlsv";
124 finder.AppleShowAllExtensions = true;
125 # expand the save dialogs
126 NSGlobalDomain.NSNavPanelExpandedStateForSaveMode = true;
127 NSGlobalDomain.NSNavPanelExpandedStateForSaveMode2 = true;
128 LaunchServices.LSQuarantine = false; # disables "Are you sure?" for new apps
129 loginwindow.GuestEnabled = false;
130
131 NSGlobalDomain."com.apple.trackpad.scaling" = 0.875;
132
133 CustomSystemPreferences = {
134 "com.apple.DiskArbitration.diskarbitrationd" = {
135 DADisableEjectNotification = true;
136 };
137 };
138
139 CustomUserPreferences = {
140 "com.apple.driver.AppleBluetoothMultitouch.mouse" = {
141 MouseButtonMode = "TwoButton";
142 };
143 "com.apple.WindowManager" = {
144 EnableTiledWindowMargins = false;
145 };
146 "com.apple.desktopservices" = {
147 # Avoid creating .DS_Store files on network or USB volumes
148 DSDontWriteNetworkStores = true;
149 DSDontWriteUSBStores = true;
150 };
151 "com.apple.AdLib" = {
152 allowApplePersonalizedAdvertising = false;
153 };
154 "com.apple.SoftwareUpdate" = {
155 AutomaticCheckEnabled = true;
156 # Check for software updates daily, not just once per week
157 ScheduleFrequency = 1;
158 # Download newly available updates in background
159 AutomaticDownload = 1;
160 # Install System data files & security updates
161 CriticalUpdateInstall = 1;
162 };
163 # keybindings
164 # Script to export symbolic hotkey configs from MacOS
165 # https://gist.github.com/sawadashota/8e7ce32234e0f07a03e955f22ec4c0f9
166 # Screenshot selected area to file with Cmd+Option+Shift+4
167 "com.apple.symbolichotkeys" = {
168 AppleSymbolicHotKeys = {
169 # Screenshot selected area with Option+Cmd+Shift+4
170 "30" = {
171 enabled = true;
172 value = {
173 parameters = [
174 52
175 21
176 1703936
177 ];
178 type = "standard";
179 };
180 };
181 # Screenshot selected area to clipboard with Cmd+Shift+4
182 "31" = {
183 enabled = true;
184 value = {
185 parameters = [
186 52
187 21
188 1179648
189 ];
190 type = "standard";
191 };
192 };
193 # Fullscreen screenshot Option+Cmd+Shift+3
194 "28" = {
195 enabled = true;
196 value = {
197 parameters = [
198 51
199 20
200 1703936
201 ];
202 type = "standard";
203 };
204 };
205 # Fullscreen screenshot to clipboard Cmd+Shift+3
206 "29" = {
207 enabled = true;
208 value = {
209 parameters = [
210 51
211 20
212 1179648
213 ];
214 type = "standard";
215 };
216 };
217 };
218 };
219 };
220 };
221
222 # Used for backwards compatibility, please read the changelog before changing
223 system.stateVersion = 4;
224}