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