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