this repo has no description
1{ self, pkgs, pkgs-unstable, ... }: {
2 # List packages installed in system profile. To search by name, run:
3 # $ nix-env -qaP | grep wget
4 environment.systemPackages =
5 [
6 pkgs.fzf
7 pkgs.tmux
8 pkgs.tree
9 pkgs.vim
10 pkgs.git
11 pkgs.ollama
12 # used for remote linux deployment
13 pkgs.nixos-rebuild
14 # I don't want to touch this due to current neovim settings.
15 # remove it when lux.nvim is out
16 (pkgs-unstable.lua5_1.withPackages (ps: with ps; [luarocks]))
17 ];
18
19 launchd.user.agents = {
20 # reference:
21 # - https://www.danielcorin.com/til/nix-darwin/launch-agents/
22 # - https://medium.com/@anand34577/setting-up-ollama-as-a-background-service-on-macos-66f7492b5cc8
23 ollama-serve = {
24 environment = {
25 OLLAMA_HOST = "0.0.0.0";
26 };
27 serviceConfig = {
28 Label = "com.ollama.serve";
29 ProgramArguments = [ "${pkgs.ollama}/bin/ollama" "serve" ];
30 KeepAlive = true;
31 RunAtLoad = true;
32 # TODO: ensure /var/log/ollama exist
33 # StandardOutPath = "/var/log/ollama/stdout.log";
34 # StandardErrorPath = "/var/log/ollama/stderr.log";
35 StandardOutPath = "/tmp/ollama_boltless.log";
36 StandardErrorPath = "/tmp/ollama_boltless.err";
37 };
38 };
39 # reference: https://gist.github.com/echo-dave/0d1ee6951c4e3bf00d738e84868e7d59
40 ssh-use-keychain = {
41 serviceConfig = {
42 Label = "sshusekeychain";
43 ProgramArguments = [ "bash" "-c" "ssh-add" "--apple-load-keychain" ];
44 RunAtLoad = true;
45 KeepAlive = false;
46 StandardOutPath = "/var/log/usekeychain.log";
47 StandardErrorPath = "/var/log/usekeychain.log";
48 };
49 };
50 };
51
52 # Necessary for using flakes on this system.
53 nix.settings.experimental-features = "nix-command flakes";
54 # Enable rosetta binaries
55 nix.settings.extra-platforms = "x86_64-darwin aarch64-darwin";
56
57 nix.settings.trusted-users = [ "@admin" ];
58 nix.settings.extra-trusted-users = [ "boltless" ];
59
60 nix.linux-builder = {
61 enable = true;
62 maxJobs = 6;
63 config.virtualisation = {
64 cores = 8;
65 };
66 };
67
68 # Enable alternative shell support in nix-darwin.
69 # programs.fish.enable = true;
70
71 system.primaryUser = "boltless";
72
73 # Set Git commit hash for darwin-version.
74 system.configurationRevision = self.rev or self.dirtyRev or null;
75
76 # Used for backwards compatibility, please read the changelog before changing.
77 # $ darwin-rebuild changelog
78 system.stateVersion = 5;
79
80 # The platform the configuration will be used on.
81 nixpkgs.hostPlatform = "aarch64-darwin";
82
83 system.defaults.finder = {
84 FXRemoveOldTrashItems = true;
85 ShowPathbar = true;
86 ShowStatusBar = true;
87 };
88
89 system.defaults.dock = {
90 autohide = true;
91 autohide-delay = 0.0;
92 autohide-time-modifier = 0.6;
93 mru-spaces = false;
94 show-recents = false;
95 orientation = "left";
96 # Disable bottom-right corner action
97 wvous-br-corner = 1;
98 # persistent-apps = [];
99 };
100
101 system.defaults.NSGlobalDomain = {
102 AppleShowAllExtensions = true;
103 # default minimum is 15 (225ms)
104 InitialKeyRepeat = 10;
105 # default minimum is 2 (30ms)
106 KeyRepeat = 1;
107 # Use f1, f2, etc. keys as standard function keys.
108 "com.apple.keyboard.fnState" = true;
109 };
110
111 system.defaults.controlcenter = {
112 NowPlaying = false;
113 Sound = true;
114 };
115
116 # reference https://medium.com/@zmre/nix-darwin-quick-tip-activate-your-preferences-f69942a93236
117 # for more
118 # https://gist.github.com/ChristopherA/98628f8cd00c94f11ee6035d53b0d3c6
119 # is also cool
120 system.defaults.CustomUserPreferences = {
121 # see https://apple.stackexchange.com/a/429820
122 "com.apple.Safari.SandboxBroker" = {
123 ShowDevelopMenu = true;
124 };
125 "com.apple.Safari" = {
126 IncludeDevelopMenu = true;
127 IncludeInternalDebugMenu = true;
128 SearchProviderIdentifier = "com.duckduckgo";
129 ShowFullURLInSmartSearchField = true;
130 # preview url on bottom left corner when hover links
131 ShowOverlayStatusBar = true;
132 WebAutomaticSpellingCorrectionEnabled = false;
133 WebContinuousSpellCheckingEnabled = true;
134 WebKitDeveloperExtrasEnabledPreferenceKey = true;
135 };
136 # Tried to set Mission Control keyboard shortcuts... but failed
137 # "com.apple.symbolichotkeys" = {
138 # AppleSymbolicHotKeys = {
139 # "79" = {
140 # enabled = 1;
141 # value = {
142 # parameters = [65535 123 8650752];
143 # type = "standard";
144 # };
145 # };
146 # "80" = {
147 # enabled = 1;
148 # value = {
149 # parameters = [65535 123 8781824];
150 # type = "standard";
151 # };
152 # };
153 # "81" = {
154 # enabled = 1;
155 # value = {
156 # parameters = [65535 124 8650752];
157 # type = "standard";
158 # };
159 # };
160 # "82" = {
161 # enabled = 1;
162 # value = {
163 # parameters = [65535 124 8781824];
164 # type = "standard";
165 # };
166 # };
167 # "118" = {
168 # enabled = 1;
169 # value = {
170 # parameters = [65535 18 262144];
171 # type = "standard";
172 # };
173 # };
174 # # 119 = {
175 # # enabled = 1;
176 # # value = {
177 # # parameters = [65535, 19, 262144];
178 # # type = "standard";
179 # # };
180 # # };
181 # # 120 = {
182 # # enabled = 1;
183 # # value = {
184 # # parameters = [65535, 20, 262144];
185 # # type = "standard";
186 # # };
187 # # };
188 # # 121 = {
189 # # enabled = 1;
190 # # value = {
191 # # parameters = [65535, 21, 262144];
192 # # type = "standard";
193 # # };
194 # # };
195 # # 122 = {
196 # # enabled = 1;
197 # # value = {
198 # # parameters = [65535, 23, 262144];
199 # # type = "standard";
200 # # };
201 # # };
202 # };
203 # };
204 };
205
206 # NOTE: put SaneSideButtons (installed via homebrew cask) to Login Items
207 # reference: https://discourse.nixos.org/t/automatically-launching-macos-applications-on-login/19823/2
208 # TODO: package this into single nix package with SaneSideButtons itself. See pkgs.sensible-side-buttons as a reference
209 system.activationScripts.extraActivation.text = ''
210 osascript -e 'tell application "System Events" to make login item at end with properties {path:"/Applications/SaneSideButtons.app", hidden:false}'
211 softwareupdate --install-rosetta --agree-to-license
212 '';
213
214 # # Enable Touch ID support
215 # security.pam.enableSudoTouchIdAuth = true;
216
217 homebrew = {
218 enable = true;
219 casks = [
220 "discord"
221 "docker"
222 "ghostty"
223 "raycast"
224 # there are also pkgs.sensible-side-buttons (original version) which is unfree license
225 # this one is foked version of it: "SaneSideButtons"
226 # NOTE: I should put this on Login Items manually. See: https://github.com/thealpa/SaneSideButtons
227 "sanesidebuttons"
228 ];
229 masApps = {
230 # Numbers = 409203825;
231 # Pages = 409201541;
232 # Tampermonkey = 6738342400;
233 # Things3 = 904280696;
234 # Xcode = 497799835;
235 };
236 };
237}