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