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