-
Notifications
You must be signed in to change notification settings - Fork 0
/
macos-configuration.nix
94 lines (86 loc) · 2.45 KB
/
macos-configuration.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
{ pkgs, config, ... }:
{
nix.package = pkgs.nixFlakes;
nix.settings = {
trusted-users = [
"root"
"aanar"
];
trusted-public-keys = [ "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=" ];
substituters = [ "https://devenv.cachix.org" ];
};
nix.extraOptions = ''
experimental-features = nix-command flakes
keep-outputs = true
keep-derivations = true
min-free = ${toString (1 * 1024 * 1024 * 1024)}
max-free = ${toString (5 * 1024 * 1024 * 1024)}
'';
nix.gc = {
automatic = true;
interval = {
Weekday = 0;
Hour = 0;
Minute = 0;
};
options = "--delete-older-than 30d";
};
services.nix-daemon.enable = true;
environment.systemPackages = [ ];
fonts = {
packages = [
pkgs.jetbrains-mono
pkgs.nerdfonts
];
};
system.defaults = {
NSGlobalDomain = {
ApplePressAndHoldEnabled = false;
AppleShowAllExtensions = true;
InitialKeyRepeat = 15;
KeyRepeat = 1;
NSAutomaticCapitalizationEnabled = false;
NSAutomaticDashSubstitutionEnabled = false;
NSAutomaticPeriodSubstitutionEnabled = false;
NSAutomaticQuoteSubstitutionEnabled = false;
NSAutomaticSpellingCorrectionEnabled = false;
NSDocumentSaveNewDocumentsToCloud = false;
NSNavPanelExpandedStateForSaveMode = true;
NSNavPanelExpandedStateForSaveMode2 = true;
"com.apple.mouse.tapBehavior" = 1;
"com.apple.keyboard.fnState" = true;
};
dock.autohide = true;
finder = {
AppleShowAllExtensions = true;
QuitMenuItem = true;
FXEnableExtensionChangeWarning = false;
};
trackpad = {
Clicking = true;
TrackpadRightClick = true;
};
CustomUserPreferences = {
"com.apple.coreservices.useractivityd" = {
ClipboardSharingEnabled = 1;
};
"com.microsoft.VSCode" = {
"ApplePressAndHoldEnabled" = false;
};
};
};
system.keyboard = {
enableKeyMapping = true;
remapCapsLockToControl = true;
};
programs.zsh.enable = true;
system.activationScripts.postUserActivation.text = ''
rsyncArgs="--archive --checksum --chmod=-w --copy-unsafe-links --delete"
apps_source="${config.system.build.applications}/Applications"
moniker="Nix Trampolines"
app_target_base="$HOME/Applications"
app_target="$app_target_base/$moniker"
mkdir -p "$app_target"
${pkgs.rsync}/bin/rsync $rsyncArgs "$apps_source/" "$app_target"
'';
}