I DO NOT KNOW WHAT IM DOING
1{
2 description = "Tynan's nix-darwin system flake";
3
4 inputs = {
5 nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
6 nix-darwin.url = "github:nix-darwin/nix-darwin/master";
7 nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
8 };
9
10 outputs =
11 inputs@{
12 self,
13 nix-darwin,
14 nixpkgs,
15 ...
16 }:
17 let
18 configuration =
19 { pkgs, ... }: {
20 security.pam.services.sudo_local.touchIdAuth = true;
21 # List packages installed in system profile. To search by name, run:
22 # $ nix-env -qaP | grep wget
23 environment.systemPackages = with pkgs; [
24 neovim
25 slack
26 notion-app
27 iterm2
28 discord
29 bitwarden-desktop
30 raycast
31 net-news-wire
32 bitwarden-desktop
33 zed-editor
34 obsidian
35
36 # nix tools
37 nixfmt
38 ];
39
40 environment.variables = {
41 GIT_AUTHOR_NAME = "Tynan Purdy";
42 GIT_AUTHOR_EMAIL = "did:plc:6ayddqghxhciedbaofoxkcbs";
43 };
44
45 system = {
46 defaults = {
47 CustomUserPreferences = {
48 "com.apple.symbolichotkeys" = {
49 AppleSymbolicHotKeys = {
50 "64" = {
51 # Disable 'Cmd + Space' for Spotlight Search
52 enabled = false;
53 };
54 };
55 };
56 };
57 dock = {
58 # Dock settings
59 autohide = true;
60 show-recents = false;
61 showAppExposeGestureEnabled = true;
62 persistent-apps = [
63 "Applications/Zen.app"
64 "Applications/Beeper Desktop.app"
65 "${pkgs.discord}/Applications/Discord.app"
66 "Applications/Fantastical.app"
67 ];
68 };
69 finder = {
70 FXPreferredViewStyle = "clmv";
71 ShowPathbar = true;
72 _FXSortFoldersFirst = true;
73 };
74 trackpad = {
75 TrackpadThreeFingerVertSwipeGesture = 2;
76 };
77 };
78 keyboard = {
79 enableKeyMapping = true;
80 remapCapsLockToEscape = true;
81 };
82 primaryUser = "tynanpurdy";
83 };
84
85 homebrew = {
86 enable = true;
87 onActivation.cleanup = "zap";
88
89 brews = [
90 ];
91
92 casks = [
93 "todoist-app"
94 "markedit"
95 "qobuz"
96 "zen"
97 "stats"
98 "affinity"
99 "linearmouse"
100 "figma"
101 "beeper"
102 "proton-mail-bridge"
103 "monitorcontrol"
104 "helium-browser"
105 "tailscale-app"
106 "orcaslicer"
107 "webviewscreensaver"
108 ];
109
110 masApps = {
111 "Fantastical" = 975937182;
112 "Aeronaut" = 6670275450;
113 "Crouton" = 1461650987;
114 "Barbee" = 1548711022;
115 "Copilot Money" = 1447330651;
116 "Flighty" = 1358823008;
117 "Tripsy" = 1429967544;
118 "Parcel" = 375589283;
119 };
120 };
121
122 environment.shellAliases = {
123 drs = "sudo darwin-rebuild switch --flake /etc/nix-darwin";
124 };
125
126 # Necessary for using flakes on this system.
127 nix.settings.experimental-features = "nix-command flakes";
128
129 # Enable alternative shell support in nix-darwin.
130 programs.fish.enable = true;
131
132 # Set Git commit hash for darwin-version.
133 system.configurationRevision = self.rev or self.dirtyRev or null;
134
135 # Used for backwards compatibility, please read the changelog before changing.
136 # $ darwin-rebuild changelog
137 system.stateVersion = 6;
138
139 # The platform the configuration will be used on.
140 nixpkgs.hostPlatform = "aarch64-darwin";
141 nixpkgs.config.allowUnfree = true;
142 };
143 in
144 {
145 # Build darwin flake using:
146 # $ darwin-rebuild build --flake .#MacBook-Air
147 darwinConfigurations."Kare" = nix-darwin.lib.darwinSystem {
148 modules = [
149 configuration
150 ];
151 };
152 };
153}