This repository has no description
4.7 kB
182 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 };
124 };
125
126 # Create /etc/zshrc that loads the nix-darwin environment.
127 programs.zsh.enable = true; # default shell on catalina
128 programs.zsh.shellInit = self.packages.${pkgs.system}.zsh.zshrc;
129 programs.zsh.promptInit = ""; # Disable default prompt
130 programs.zsh.interactiveShellInit = ''
131 export SSH_AUTH_SOCK=/Users/lassulus/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh
132 '';
133
134 # enable sudo touch
135 security.pam.services.sudo_local.touchIdAuth = true;
136
137 # Enable Touch ID in tmux sessions with pam_reattach
138 security.pam.services.sudo_local.text = lib.mkBefore ''
139 auth optional ${pkgs.pam-reattach}/lib/pam/pam_reattach.so ignore_ssh
140 '';
141
142 # disable natural scrolling
143 system.defaults.NSGlobalDomain."com.apple.swipescrolldirection" = false;
144 programs.direnv.enable = true;
145 programs.nix-index.enable = true;
146 programs.gnupg.agent = {
147 enable = true;
148 enableSSHSupport = true;
149 };
150
151 # Used for backwards compatibility, please read the changelog before changing.
152 # $ darwin-rebuild changelog
153 system.stateVersion = 6;
154
155 system.primaryUser = "lassulus";
156
157 services.openssh.enable = true;
158 users.users.lassulus.openssh.authorizedKeys.keys = [
159 self.keys.ssh.barnacle.public
160 self.keys.ssh.yubi_pgp.public
161 self.keys.ssh.yubi1.public
162 self.keys.ssh.yubi2.public
163 self.keys.ssh.solo2.public
164 self.keys.ssh.xerxes.public
165 ];
166 users.users.root.openssh.authorizedKeys.keys = [
167 self.keys.ssh.barnacle.public
168 self.keys.ssh.yubi_pgp.public
169 self.keys.ssh.yubi1.public
170 self.keys.ssh.yubi2.public
171 self.keys.ssh.solo2.public
172 self.keys.ssh.xerxes.public
173 ];
174
175 users.users.root.shell = pkgs.zsh;
176 users.users.root.uid = 0;
177 users.knownUsers = [ "root" ];
178
179 system.activationScripts.postActivation.text = ''
180 install ${./US_INTL.keylayout} /Library/Keyboard\ Layouts/US_INTL.keylayout
181 '';
182}