-
Notifications
You must be signed in to change notification settings - Fork 1
/
common-config.nix
367 lines (339 loc) · 9.98 KB
/
common-config.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
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
{ config, pkgs, ... }:
let
sshKeys = [
];
in {
boot = {
loader = {
systemd-boot = { enable = true; };
efi = { canTouchEfiVariables = true; };
};
cleanTmpDir = false;
kernelModules = [
"v4l2loopback"
];
extraModulePackages = [
config.boot.kernelPackages.v4l2loopback
];
};
hardware = {
enableAllFirmware = true;
enableRedistributableFirmware = true;
firmware = [ pkgs.sof-firmware ];
bluetooth = { enable = false; };
trackpoint = {
enable = true;
speed = 130;
emulateWheel = true;
};
deviceTree = { enable = true; };
pulseaudio = {
enable = true;
support32Bit = true;
package = pkgs.pulseaudioFull;
systemWide = false;
tcp = { enable = true; };
};
};
system = {
autoUpgrade = {
enable = true;
allowReboot = false;
dates = if config.networking.hostName == "nixos-02" then "04:00" else "daily";
randomizedDelaySec = "45min";
};
};
systemd = {
services = {
gromit = {
enable = true;
description = "gromit-mpx";
environment = {
DISPLAY = ":0";
XDG_CURRENT_DESKTOP = "none+xmonad";
};
wantedBy = [ "multi-user.target" ];
after = [ "display-manager.service" ];
partOf = [ "graphical.target" ];
startLimitBurst = 10;
startLimitIntervalSec = 300;
serviceConfig = {
Type = "simple";
User = "mario";
ExecStart = "/run/current-system/sw/bin/gromit-mpx";
Restart = "always";
RestartSec = 30;
};
};
};
};
time = {
timeZone = "America/Sao_Paulo";
hardwareClockInLocalTime = true;
};
sound = {
enable = true;
mediaKeys = {
enable = true;
volumeStep = "5%";
};
};
powerManagement = { enable = true; };
users = {
mutableUsers = false;
defaultUserShell = pkgs.fish;
users = {
mario = {
isNormalUser = true;
useDefaultShell = true;
home = "/home/mario";
extraGroups = [ "wheel" "vboxusers" "docker" "audio" "volume" ];
hashedPassword =
"";
openssh = {
authorizedKeys = { keys = sshKeys; };
};
};
};
users = {
root = {
isSystemUser = true;
openssh = {
authorizedKeys = { keys = sshKeys; };
};
};
};
};
i18n = { defaultLocale = "en_US.UTF-8"; };
console = {
font = "Lat2-Terminus16";
keyMap = "us";
};
services = {
openssh = {
enable = true;
passwordAuthentication = false;
permitRootLogin = "prohibit-password";
allowSFTP = true;
extraConfig = ''
PermitUserEnvironment yes
'';
};
cron = {
enable = true;
systemCronJobs = [
"0 0 1 * * mario docker system prune --all --force"
];
};
lorri = { enable = true; };
xserver = {
enable = true;
layout = "br";
xrandrHeads = [ "HDMI-1" "eDP-1" ];
xkbOptions = "caps:ctrl_modifier";
windowManager = {
xmonad = {
enable = true;
enableContribAndExtras = true;
extraPackages = hpkgs: [
hpkgs.xmonad
hpkgs.xmonad-contrib
hpkgs.xmonad-extras
];
};
};
displayManager = { xpra = { pulseaudio = true; }; };
libinput = {
enable = true;
touchpad = {
naturalScrolling = true;
};
mouse = {
naturalScrolling = true;
};
};
displayManager = {
defaultSession = "none+xmonad";
lightdm = { enable = true; };
};
desktopManager = {
wallpaper = {
mode = "fill";
combineScreens = false;
};
};
};
acpid = { enable = true; };
gnome = { gnome-keyring = { enable = true; }; };
printing = { enable = true; };
actkbd = {
enable = true;
bindings = [
{
keys = [ 224 ];
events = [ "key" ];
command = "/run/current-system/sw/bin/light -U 10";
}
{
keys = [ 225 ];
events = [ "key" ];
command = "/run/current-system/sw/bin/light -A 10";
}
];
};
jack = {
alsa = {
enable = true;
support32Bit = false;
};
loopback = { enable = false; };
};
upower = {
enable = true;
usePercentageForPolicy = true;
criticalPowerAction = "HybridSleep";
percentageCritical = 10;
};
clipmenu = { enable = true; };
picom = {
enable = true;
fade = false;
shadow = true;
fadeDelta = 1;
activeOpacity = 1.0;
inactiveOpacity = 0.92;
menuOpacity = 1.0;
shadowOffsets = [ (-15) (-15) ];
vSync = false;
};
};
nixpkgs = {
config = {
allowUnfree = true;
pulseaudio = true;
};
};
nix = {
trustedUsers = [ "root" "mario" "@wheel" ];
buildCores = if config.networking.hostName == "nixos-02" then 4 else 2;
nrBuildUsers = 40;
autoOptimiseStore = true;
optimise = { automatic = true; dates = [ "03:00" "11:00" ]; };
gc = {
automatic = if config.networking.hostName == "nixos-02" then true else false;
dates = "monthly";
options = "--delete-older-than 10d";
};
distributedBuilds = true;
buildMachines = [
{
hostName = if config.networking.hostName == "nixos-02" then "01-builder" else "02-builder";
system = "x86_64-linux";
maxJobs = 8;
speedFactor = 3;
sshUser = "root";
}
];
extraOptions = ''
connect-timeout = 5
max-jobs = 8
max-silent-time = 240
builders-use-substitutes = false
fallback = true
substitute = true
substituters = ${if config.networking.hostName == "nixos-02" then "01-builder" else "02-builder"} https://cache.nixos.org
'';
};
virtualisation = {
docker = { enable = true; };
virtualbox = {
host = {
enable = true;
enableHardening = true;
addNetworkInterface = true;
enableExtensionPack = true;
headless = false;
};
guest = {
enable = true;
};
};
};
programs = {
gnupg = { agent = { enable = true; }; };
bash = { enableCompletion = true; };
vim = { defaultEditor = true; };
slock = { enable = true; };
light = { enable = true; };
java = { enable = true; };
ssh = {
extraConfig = builtins.readFile "/home/mario/.ssh/config";
};
};
fonts = { fonts = with pkgs; [ nerdfonts ]; };
networking = {
useDHCP = false;
};
environment = {
variables = {
BROWSER = "/run/current-system/sw/bin/firefox";
_JAVA_AWT_WM_NONREPARENTING = "1";
DOCKER_BUILDKIT = "1";
};
shellInit = ''
xcape -e "Caps_Lock=Escape"
'';
systemPackages = with pkgs; [
alacritty # A cross-platform, GPU-accelerated terminal emulator
azure-cli # Next generation multi-platform command line experience for Azure
bat # A cat(1) clone with syntax highlighting and Git integration
broot # An interactive tree view, a fuzzy search, a balanced BFS descent and customizable commands
clang # A c, c++, objective-c, and objective-c++ frontend for the llvm compiler (wrapper script)
cmake # Cross-Platform Makefile Generator
colordiff # Wrapper for 'diff' that produces the same output but with pretty 'syntax' highlighting
direnv # A shell extension that manages your environment
docker-compose # Multi-container orchestration for Docker
exa # Replacement for 'ls' written in Rust
fd # A simple, fast and user-friendly alternative to find
firefox # A web browser built from Firefox source tree (with plugins: )
flameshot # Powerful yet simple to use screenshot software
gcc # GNU Compiler Collection, version 9.3.0 (wrapper script)
gdb # The GNU Project debugger
ghc # The Glasgow Haskell Compiler
ghcid # GHCi based bare bones IDE
gitAndTools.delta # A syntax-highlighting pager for git
gitAndTools.gitFull # Distributed version control system
gitAndTools.gitflow # Extend git with the Gitflow branching model
gitAndTools.gitui # Blazing fast terminal-ui for git written in rust
gnumake # A tool to control the generation of non-source files from sources
go-tools # A collection of tools and libraries for working with Go code, including linters and static analysis
gromit-mpx # Desktop annotation tool
haskellPackages.hoogle
haskellPackages.xmobar
home-manager # A user environment configurator
htop # An interactive process viewer for Linux
irssi # A terminal based IRC client
jq # A lightweight and flexible command-line JSON processor
kubectl # Kubernetes CLI
manix # A Fast Documentation Searcher for Nix
mkpasswd # Overfeatured front-end to crypt, from the Debian whois package
nixopsUnstable # NixOS cloud provisioning and deployment tool
ranger # File manager with minimalistic curses interface
ripgrep # A utility that combines the usability of The Silver Searcher with the raw speed of grep
ripgrep-all # Ripgrep, but also search in PDFs, E-Books, Office documents, zip, tar.gz, and more
starship # A minimal, blazing fast, and extremely customizable prompt for any shell
terraform # Tool for building, changing, and versioning infrastructure
tmuxp # Manage tmux workspaces from JSON and YAML
tree # Command to produce a depth indented directory listing
unrar # Utility for RAR archives
unzip # An extraction utility for archives compressed in .zip format
wget # Tool for retrieving files using HTTP, HTTPS, and FTP
xorg.xev
xorg.xmodmap
yadm # Yet Another Dotfiles Manager
zathura # A highly customizable and functional PDF viewer
zip # Compressor/archiver for creating and modifying zipfiles
zoxide # A fast cd command that learns your habits
];
};
}