-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfiguration.nix
More file actions
183 lines (152 loc) · 4.55 KB
/
configuration.nix
File metadata and controls
183 lines (152 loc) · 4.55 KB
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
{
pkgs,
lib,
type ? "personal",
...
}:
let
username = "john";
isDarwin = pkgs.stdenv.isDarwin;
isLinux = pkgs.stdenv.isLinux;
in
{
nix.enable = false;
#nix.settings = {
# experimental-features = "nix-command flakes";
# keep-going = true;
#};
security.pam.services.sudo_local.touchIdAuth = true;
system.primaryUser = username;
system.startup.chime = false;
environment = {
shellAliases = {
g = "git";
gs = "git status";
gc = "git commit";
gaa = "git add --all";
gpu = "git push";
gpuf = "git push --force-with-lease";
vim = "nvim";
la = "ls -oaGh";
darwin-rebuild-switch = "sudo ~/.config/nix/rebuild-and-switch.sh";
darwin-rebuild-switch-work = "sudo ~/.config/nix/rebuild-and-switch-work.sh";
darwin-cleanup = "sudo nix-collect-garbage --delete-older-than 7d";
flake-update = "(cd /Users/${username}/.config/nix && nix flake update)";
mkdir = "mkdir -p";
docker = "podman";
};
systemPath = [
"/opt/homebrew/bin"
"$HOME/Library/Android/sdk"
"/Users/john/Library/Python/3.9/bin"
"$PATH:$ANDROID_HOME/emulator"
"$PATH:$ANDROID_HOME/platform-tools"
];
};
fonts.packages = [
pkgs.nerd-fonts.jetbrains-mono
];
# Automatic updating
# system.autoUpgrade.enable = true;
# system.autoUpgrade.dates = "weekly";
#nix.gc.automatic = true;
#nix.gc.options = "--delete-older-than 7d";
#nix.optimise.automatic = true;
system.defaults = {
NSGlobalDomain = {
# Sets Trackpad -> Point & Click -> Tracking speed
"com.apple.trackpad.scaling" = 3.0;
# Enables Trackpad -> Point & Click -> Force Click and haptic feedback
"com.apple.trackpad.forceClick" = true;
# Enables Trackpad -> Scroll & Zoom -> Natural scrolling and Mouse -> Nautral scrolling
"com.apple.swipescrolldirection" = true;
# Tap to click
"com.apple.mouse.tapBehavior" = 1;
# Sets Language & Region -> Measurement system to "Metric"
AppleMeasurementUnits = "Centimeters";
# Sets Language & Region -> Measurement system to "Metric"
AppleMetricUnits = 1;
# Sets Language & Region -> Temperature to "Celsius"
AppleTemperatureUnit = "Celsius";
# Enables Date & Time -> 24-hour time
AppleICUForce24HourTime = true;
# Sets Appearance -> Show scroll bars to "Always"
AppleShowScrollBars = "Always";
# Disable font smoothing
# https://tonsky.me/blog/monitors/
AppleFontSmoothing = 0;
AppleInterfaceStyle = "Dark";
# Automatic dark and light mode
# AppleInterfaceStyleSwitchesAutomatically = true;
KeyRepeat = 2;
# Move windows by holding ctrl+cmd and dragging any part of the window
NSWindowShouldDragOnGesture = true;
};
screensaver = {
askForPasswordDelay = 0;
askForPassword = true;
};
controlcenter = {
BatteryShowPercentage = true;
Bluetooth = true;
Sound = true;
};
screencapture = {
show-thumbnail = true;
target = "clipboard";
};
CustomUserPreferences = {
NSGlobalDomain = {
AppleLanguages = [
"en-US"
];
# Sets Language & Region -> First day of week to "Monday"
AppleFirstWeekday = {
gregorian = 2;
};
};
"com.apple.AppleMultitouchTrackpad" = {
# Enables Trackpad -> Point & Click -> Tap to click
Clicking = 1;
# Sets Accessibility -> Motor -> Pointer Control -> Mouse & Trackpad -> Trackpad Options -> Dragging style to "Three Finger Drag"
TrackpadThreeFingerDrag = 1;
TrackpadThreeFingerHorizSwipeGesture = 0;
TrackpadThreeFingerTapGesture = 0;
TrackpadThreeFingerVertSwipeGesture = 0;
};
# App Store
"com.apple.commerce" = {
# Disables Automatic Updates
AutoUpdate = false;
};
};
loginwindow.GuestEnabled = false;
};
nixpkgs.config.allowUnfree = true;
# nixpkgs.config.permittedInsecurePackages = [
# "qtwebengine-5.15.19"
# ];
users.users.${username} = {
name = username;
home = "/Users/${username}";
};
imports = [
./macos/dock.nix
./macos/homebrew.nix
# ./macos/karabiner.nix
];
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.${username} = import ./home.nix;
extraSpecialArgs = {
inherit type;
};
};
system.activationScripts.preActivation.text = ''
if ! xcode-select --version 2>/dev/null; then
xcode-select --install
fi
'';
system.stateVersion = 5;
}