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