11{
2- config ,
32 pkgs ,
43 lib ,
54 ...
65} :
76
8- with lib ;
9-
107{
118 imports = [
129 ./diffoscope.nix
@@ -17,61 +14,71 @@ with lib;
1714
1815 nixpkgs . config . allowUnfree = true ;
1916
20- services . openssh . authorizedKeysFiles = mkForce [ "/etc/ssh/authorized_keys.d/%u" ] ;
21-
22- boot . kernelModules = [ "coretemp" ] ;
23-
24- # Prevent "out of sync" errors on the KVM switch.
25- boot . vesa = false ;
26- boot . blacklistedKernelModules = [
27- "radeonfb"
28- "radeon"
29- "i915"
30- ] ;
31- boot . kernelParams = [ "nomodeset" ] ;
32-
3317 hardware . enableAllFirmware = true ;
3418 hardware . cpu . amd . updateMicrocode = true ;
3519 hardware . cpu . intel . updateMicrocode = true ;
3620
37- environment . systemPackages = [
38- pkgs . emacs
39- pkgs . sysstat
40- pkgs . hdparm
41- pkgs . sdparm # pkgs.lsiutil
42- pkgs . htop
43- pkgs . sqlite
44- pkgs . iotop
45- pkgs . lm_sensors
46- pkgs . hwloc
47- pkgs . lsof
48- pkgs . numactl
49- pkgs . gcc
50- pkgs . smartmontools
51- pkgs . tcpdump
52- pkgs . gdb
53- pkgs . elfutils
54- ] ;
21+ boot . kernel . sysctl = {
22+ # reboot on kernel panic
23+ "kernel.panic" = 60 ;
24+ "kernel.panic_on_oops" = 1 ;
25+ } ;
5526
56- services . openssh . enable = true ;
27+ documentation . nixos . enable = false ;
5728
58- boot . kernel . sysctl . "kernel.panic" = 60 ;
59- boot . kernel . sysctl . "kernel.panic_on_oops" = 1 ;
29+ environment = {
30+ enableDebugInfo = true ;
31+ systemPackages = with pkgs ; [
32+ # debugging
33+ gdb
34+ lsof
35+ sqlite-interactive
36+
37+ # editors
38+ emacs
39+ helix
40+ neovim
41+
42+ # utilities
43+ ripgrep
44+ fd
45+
46+ # system introspection
47+ hdparm
48+ htop
49+ iotop
50+ lm_sensors
51+ nvme-cli
52+ smartmontools
53+ sysstat
54+ tcpdump
55+ tmux
56+ ] ;
57+ } ;
6058
61- nix . nrBuildUsers = 100 ;
59+ services . openssh = {
60+ enable = true ;
61+ authorizedKeysFiles = lib . mkForce [ "/etc/ssh/authorized_keys.d/%u" ] ;
62+ } ;
6263
6364 nix . extraOptions = ''
6465 allowed-impure-host-deps = /etc/protocols /etc/services /etc/nsswitch.conf
6566 allowed-uris = https://github.com/ https://git.savannah.gnu.org/ github:
6667 '' ;
6768
69+ # we use networkd
6870 networking . useDHCP = false ;
6971
70- networking . firewall . enable = true ;
71- networking . firewall . rejectPackets = true ;
72- networking . firewall . allowPing = true ;
73- networking . firewall . allowedTCPPorts = [ 10050 ] ;
74- networking . firewall . logRefusedConnections = false ;
72+ networking . firewall = {
73+ enable = true ;
74+
75+ # be a good network citizen and allow some debugging interactions
76+ rejectPackets = true ;
77+ allowPing = true ;
78+
79+ # prevent firewall log spam from rotating the kernel rinbuffer
80+ logRefusedConnections = false ;
81+ } ;
7582
7683 services . resolved = {
7784 enable = true ;
@@ -84,37 +91,10 @@ with lib;
8491 ] ;
8592 } ;
8693
87- # Bump the open files limit so that non-root users can run NixOS VM
88- # tests (Samba opens lot of files).
89- security . pam . loginLimits = [
90- {
91- domain = "*" ;
92- item = "nofile" ;
93- type = "-" ;
94- value = "16384" ;
95- }
96- ] ;
97-
98- # Enable Kernel Samepage Merging (reduces memory footprint of VMs).
99- hardware . ksm . enable = true ;
100-
101- # Disable the systemd-journald watchdog. The default timeout (1min)
102- # can easily be triggered on our slow, heavily-loaded disks. And
103- # that may cause services writing to the journal to fail until
104- # they're restarted.
105- systemd . services . systemd-journald . serviceConfig . WatchdogSec = 0 ;
106-
107- environment . enableDebugInfo = true ;
108-
109- systemd . tmpfiles . rules = [ "d /tmp 1777 root root 7d" ] ;
110-
111- # Disable sending email from cron.
112- services . cron . mailto = "" ;
113-
114- documentation . nixos . enable = false ;
115-
116- security . acme . acceptTerms = true ;
117- security . acme . defaults . email = "infra@nixos.org" ;
94+ security . acme = {
95+ acceptTerms = true ;
96+ defaults . email = "infra@nixos.org" ;
97+ } ;
11898
11999 services . zfs . autoScrub . enable = true ;
120100}
0 commit comments