This repository has no description
5.1 kB
187 lines
1{
2 pkgs,
3 self,
4 lib,
5 ...
6}:
7
8{
9 imports = [
10 self.inputs.nix-index-database.darwinModules.nix-index
11 self.inputs.nix-rosetta-builder.darwinModules.default
12 ];
13 clan.core.networking.targetHost = "root@localhost";
14 programs.nix-index-database.comma.enable = true;
15
16 nixpkgs.hostPlatform = "aarch64-darwin";
17 environment.systemPackages = [
18 self.packages.${pkgs.system}.nvim
19 self.packages.${pkgs.system}.pass
20 self.packages.${pkgs.system}.passmenu
21 self.packages.${pkgs.system}.tmux
22 self.packages.${pkgs.system}.mutt
23 self.packages.${pkgs.system}.notmuch
24 self.packages.${pkgs.system}.claude
25 self.packages.${pkgs.system}.mpv
26 self.packages.${pkgs.system}.s
27
28 self.packages.${pkgs.system}.secretive
29
30 # zsh dependencies
31 pkgs.fzf
32 pkgs.atuin
33
34 pkgs.gnupg
35 pkgs.pinentry_mac
36 pkgs.lazygit
37 pkgs.sshuttle
38 pkgs.git
39 pkgs.iterm2
40 (self.lib.halalify pkgs.firefox-bin-unwrapped)
41 pkgs.ripgrep
42 pkgs.alt-tab-macos
43 pkgs.nixd
44 pkgs.nil
45 pkgs.age-plugin-se
46 pkgs.gh
47 pkgs.tea
48 pkgs.rbw
49 ];
50
51 environment.variables = {
52 EDITOR = "nvim";
53 };
54
55 # Use a custom configuration.nix location.
56 # $ darwin-rebuild switch -I darwin-config=$HOME/.config/nixpkgs/darwin/configuration.nix
57 # environment.darwinConfig = "$HOME/.config/nixpkgs/darwin/configuration.nix";
58
59 nix = {
60 package = pkgs.nix;
61 settings = {
62 extra-experimental-features = [
63 "nix-command"
64 "flakes"
65 ];
66 };
67 };
68
69 # homebrew = {
70 # enable = true;
71 # casks = [
72 # "gpg-suite"
73 # ];
74 # };
75
76 # keyboard settings
77 system.keyboard = {
78 enableKeyMapping = true;
79 };
80
81 # Add skhd for keyboard shortcuts
82 services.skhd = {
83 enable = true;
84 skhdConfig = ''
85 # Test with simpler combo first
86 cmd - f12 : /usr/bin/say "test works"
87 # Open passmenu with Hyper-P
88 ctrl + shift + alt + cmd - p : /run/current-system/sw/bin/passmenu
89 '';
90 };
91
92 system.defaults = {
93 # minimal dock
94 dock = {
95 autohide = true;
96 orientation = "left";
97 show-process-indicators = false;
98 show-recents = false;
99 static-only = true;
100 };
101 # a finder that tells me what I want to know and lets me work
102 finder = {
103 AppleShowAllExtensions = true;
104 ShowPathbar = true;
105 FXEnableExtensionChangeWarning = false;
106 };
107 # Tab between form controls and F-row that behaves as F1-F12
108 NSGlobalDomain = {
109 AppleKeyboardUIMode = 3;
110 "com.apple.keyboard.fnState" = true;
111 };
112 };
113
114 # Enable Rosetta builder for x86_64 builds
115 nix-rosetta-builder = {
116 enable = true;
117 potentiallyInsecureExtraNixosModule = {
118 # Fix DNS resolution in the VM
119 networking.nameservers = [
120 "8.8.8.8"
121 "1.1.1.1"
122 ];
123 # Pin to Linux 6.12 LTS to avoid "rosetta error: unhandled auxillary
124 # vector type 29" — newer kernels (6.18+) expose AT_MINSIGSTKSZ which
125 # Rosetta doesn't handle yet.
126 # https://github.com/lima-vm/lima/issues/3592
127 boot.kernelPackages = (import self.inputs.nixpkgs { system = "aarch64-linux"; }).linuxKernel.packages.linux_6_12;
128 };
129 };
130
131 # Create /etc/zshrc that loads the nix-darwin environment.
132 programs.zsh.enable = true; # default shell on catalina
133 programs.zsh.shellInit = self.packages.${pkgs.system}.zsh.zshrc;
134 programs.zsh.promptInit = ""; # Disable default prompt
135 programs.zsh.interactiveShellInit = ''
136 export SSH_AUTH_SOCK=/Users/lassulus/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh
137 '';
138
139 # enable sudo touch
140 security.pam.services.sudo_local.touchIdAuth = true;
141
142 # Enable Touch ID in tmux sessions with pam_reattach
143 security.pam.services.sudo_local.text = lib.mkBefore ''
144 auth optional ${pkgs.pam-reattach}/lib/pam/pam_reattach.so ignore_ssh
145 '';
146
147 # disable natural scrolling
148 system.defaults.NSGlobalDomain."com.apple.swipescrolldirection" = false;
149 programs.direnv.enable = true;
150 programs.nix-index.enable = true;
151 programs.gnupg.agent = {
152 enable = true;
153 enableSSHSupport = true;
154 };
155
156 # Used for backwards compatibility, please read the changelog before changing.
157 # $ darwin-rebuild changelog
158 system.stateVersion = 6;
159
160 system.primaryUser = "lassulus";
161
162 services.openssh.enable = true;
163 users.users.lassulus.openssh.authorizedKeys.keys = [
164 self.keys.ssh.barnacle.public
165 self.keys.ssh.yubi_pgp.public
166 self.keys.ssh.yubi1.public
167 self.keys.ssh.yubi2.public
168 self.keys.ssh.solo2.public
169 self.keys.ssh.xerxes.public
170 ];
171 users.users.root.openssh.authorizedKeys.keys = [
172 self.keys.ssh.barnacle.public
173 self.keys.ssh.yubi_pgp.public
174 self.keys.ssh.yubi1.public
175 self.keys.ssh.yubi2.public
176 self.keys.ssh.solo2.public
177 self.keys.ssh.xerxes.public
178 ];
179
180 users.users.root.shell = pkgs.zsh;
181 users.users.root.uid = 0;
182 users.knownUsers = [ "root" ];
183
184 system.activationScripts.postActivation.text = ''
185 install ${./US_INTL.keylayout} /Library/Keyboard\ Layouts/US_INTL.keylayout
186 '';
187}