-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdarwin.nix
executable file
·155 lines (128 loc) · 3.95 KB
/
darwin.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
{ config, lib, pkgs, ... }:
{
system.defaults.NSGlobalDomain = {
"com.apple.trackpad.scaling" = 1.5;
AppleInterfaceStyle = "Dark";
AppleMeasurementUnits = "Centimeters";
AppleMetricUnits = 1;
AppleShowScrollBars = "Automatic";
AppleTemperatureUnit = "Celsius";
InitialKeyRepeat = 15;
KeyRepeat = 2;
NSAutomaticCapitalizationEnabled = false;
NSAutomaticDashSubstitutionEnabled = false;
NSAutomaticPeriodSubstitutionEnabled = false;
NSAutomaticWindowAnimationsEnabled = false;
_HIHideMenuBar = false;
};
system.defaults.universalaccess.reduceTransparency = true;
system.defaults.universalaccess.reduceMotion = true;
# Firewall
system.defaults.alf = {
globalstate = 1;
allowsignedenabled = 1;
allowdownloadsignedenabled = 1;
stealthenabled = 1;
};
# Dock and Mission Control
system.defaults.dock = {
autohide = true;
expose-group-apps = false;
mru-spaces = false;
tilesize = 32;
# Disable all hot corners
wvous-bl-corner = 1;
wvous-br-corner = 1;
wvous-tl-corner = 1;
wvous-tr-corner = 1;
};
# Login and lock screen
system.defaults.loginwindow = {
GuestEnabled = false;
DisableConsoleAccess = true;
};
# Spaces
system.defaults.spaces.spans-displays = false;
# Trackpad
system.defaults.trackpad = {
Clicking = false;
TrackpadRightClick = true;
};
# Finder
system.defaults.finder = {
FXEnableExtensionChangeWarning = true;
};
networking = {
# In-order to configure DNS server, knownNetworkServices must be set
knownNetworkServices = [
"Wi-Fi"
"USB 10/100/1000 LAN"
];
dns = [
"1.1.1.1"
"8.8.8.8"
];
};
# Apps
# `home-manager` currently has issues adding them to `~/Applications`
# Issue: https://github.com/nix-community/home-manager/issues/1341
environment.systemPackages = with pkgs; [
alacritty
aerospace
];
programs.nix-index.enable = true;
# Keyboard
system.keyboard.enableKeyMapping = true;
system.keyboard.remapCapsLockToControl = true;
# Add ability to used TouchID for sudo authentication
security.pam.enableSudoTouchIdAuth = true;
# Nix configuration ------------------------------------------------------------------------------
nix.settings = {
substituters = [
"https://cache.nixos.org/"
"https://bsathvik.cachix.org"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"bsathvik.cachix.org-1:mQrYap3jy3tUJFO9J0pflCJEm9r41CONF5vcNm7pK2U="
];
trusted-users = [ "@admin" ];
# https://github.com/NixOS/nix/issues/7273
auto-optimise-store = false;
experimental-features = [
"nix-command"
"flakes"
"ca-derivations"
];
extra-platforms = lib.mkIf (pkgs.system == "aarch64-darwin") [ "x86_64-darwin" "aarch64-darwin" ];
# Recommended when using `direnv` etc.
keep-derivations = true;
keep-outputs = true;
};
nix.configureBuildUsers = true;
# Auto upgrade nix package and the daemon service.
services.nix-daemon.enable = true;
# Shells -----------------------------------------------------------------------------------------
# Add shells installed by nix to /etc/shells file
environment.shells = with pkgs; [
bashInteractive
fish
];
# Make Fish the default shell
programs.fish.enable = true;
programs.fish.useBabelfish = true;
programs.fish.babelfishPackage = pkgs.babelfish;
# Needed to address bug where $PATH is not properly set for fish:
# https://github.com/LnL7/nix-darwin/issues/122
programs.fish.shellInit = ''
for p in (string split : ${config.environment.systemPath})
if not contains $p $fish_user_paths
set -g fish_user_paths $fish_user_paths $p
end
end
'';
environment.variables.SHELL = "${pkgs.fish}/bin/fish";
# Used for backwards compatibility, please read the changelog before changing.
# $ darwin-rebuild changelog
system.stateVersion = 4;
}