This repository has no description
5.0 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}.mpv
25 self.packages.${pkgs.system}.s
26
27 self.packages.${pkgs.system}.secretive
28
29 # zsh dependencies
30 pkgs.fzf
31 pkgs.atuin
32
33 pkgs.gnupg
34 pkgs.pinentry_mac
35 pkgs.lazygit
36 pkgs.sshuttle
37 pkgs.git
38 pkgs.iterm2
39 (self.lib.halalify pkgs.firefox-bin-unwrapped)
40 pkgs.ripgrep
41 pkgs.alt-tab-macos
42 pkgs.nixd
43 pkgs.nil
44 pkgs.age-plugin-se
45 pkgs.gh
46 pkgs.tea
47 pkgs.rbw
48 ];
49
50 environment.variables = {
51 EDITOR = "nvim";
52 };
53
54 # Use a custom configuration.nix location.
55 # $ darwin-rebuild switch -I darwin-config=$HOME/.config/nixpkgs/darwin/configuration.nix
56 # environment.darwinConfig = "$HOME/.config/nixpkgs/darwin/configuration.nix";
57
58 nix = {
59 package = pkgs.nix;
60 settings = {
61 extra-experimental-features = [
62 "nix-command"
63 "flakes"
64 ];
65 };
66 };
67
68 # homebrew = {
69 # enable = true;
70 # casks = [
71 # "gpg-suite"
72 # ];
73 # };
74
75 # keyboard settings
76 system.keyboard = {
77 enableKeyMapping = true;
78 };
79
80 # Add skhd for keyboard shortcuts
81 services.skhd = {
82 enable = true;
83 skhdConfig = ''
84 # Test with simpler combo first
85 cmd - f12 : /usr/bin/say "test works"
86 # Open passmenu with Hyper-P
87 ctrl + shift + alt + cmd - p : /run/current-system/sw/bin/passmenu
88 '';
89 };
90
91 system.defaults = {
92 # minimal dock
93 dock = {
94 autohide = true;
95 orientation = "left";
96 show-process-indicators = false;
97 show-recents = false;
98 static-only = true;
99 };
100 # a finder that tells me what I want to know and lets me work
101 finder = {
102 AppleShowAllExtensions = true;
103 ShowPathbar = true;
104 FXEnableExtensionChangeWarning = false;
105 };
106 # Tab between form controls and F-row that behaves as F1-F12
107 NSGlobalDomain = {
108 AppleKeyboardUIMode = 3;
109 "com.apple.keyboard.fnState" = true;
110 };
111 };
112
113 # Enable Rosetta builder for x86_64 builds
114 nix-rosetta-builder = {
115 enable = true;
116 potentiallyInsecureExtraNixosModule = {
117 # Fix DNS resolution in the VM
118 networking.nameservers = [
119 "8.8.8.8"
120 "1.1.1.1"
121 ];
122 # Pin to Linux 6.12 LTS to avoid "rosetta error: unhandled auxillary
123 # vector type 29" — newer kernels (6.18+) expose AT_MINSIGSTKSZ which
124 # Rosetta doesn't handle yet.
125 # https://github.com/lima-vm/lima/issues/3592
126 boot.kernelPackages =
127 (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}