-
-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: prune common configuration #519
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6a83add
build: prune common configuration
mweinelt 32482e0
mimas: dedup options, fix eval
mweinelt cece931
hydra: remove top-level with lib
mweinelt 9519f6f
hydra: manage github client secret
mweinelt 270871c
hydra: cleanup
mweinelt df730aa
build: fix diffoscope wrapper indent
mweinelt 80fb0f7
dns: prune rhea.nixos.org
mweinelt 1bfc03f
terraform: migrate to opentofu registry
mweinelt 211023c
build: drop rhea
mweinelt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
{ | ||
config, | ||
pkgs, | ||
lib, | ||
... | ||
}: | ||
|
||
with lib; | ||
|
||
{ | ||
imports = [ | ||
./diffoscope.nix | ||
|
@@ -17,61 +14,71 @@ with lib; | |
|
||
nixpkgs.config.allowUnfree = true; | ||
|
||
services.openssh.authorizedKeysFiles = mkForce [ "/etc/ssh/authorized_keys.d/%u" ]; | ||
|
||
boot.kernelModules = [ "coretemp" ]; | ||
|
||
# Prevent "out of sync" errors on the KVM switch. | ||
boot.vesa = false; | ||
boot.blacklistedKernelModules = [ | ||
"radeonfb" | ||
"radeon" | ||
"i915" | ||
]; | ||
boot.kernelParams = [ "nomodeset" ]; | ||
|
||
hardware.enableAllFirmware = true; | ||
hardware.cpu.amd.updateMicrocode = true; | ||
hardware.cpu.intel.updateMicrocode = true; | ||
|
||
environment.systemPackages = [ | ||
pkgs.emacs | ||
pkgs.sysstat | ||
pkgs.hdparm | ||
pkgs.sdparm # pkgs.lsiutil | ||
pkgs.htop | ||
pkgs.sqlite | ||
pkgs.iotop | ||
pkgs.lm_sensors | ||
pkgs.hwloc | ||
pkgs.lsof | ||
pkgs.numactl | ||
pkgs.gcc | ||
pkgs.smartmontools | ||
pkgs.tcpdump | ||
pkgs.gdb | ||
pkgs.elfutils | ||
]; | ||
boot.kernel.sysctl = { | ||
# reboot on kernel panic | ||
"kernel.panic" = 60; | ||
"kernel.panic_on_oops" = 1; | ||
}; | ||
|
||
services.openssh.enable = true; | ||
documentation.nixos.enable = false; | ||
|
||
boot.kernel.sysctl."kernel.panic" = 60; | ||
boot.kernel.sysctl."kernel.panic_on_oops" = 1; | ||
environment = { | ||
enableDebugInfo = true; | ||
systemPackages = with pkgs; [ | ||
# debugging | ||
gdb | ||
lsof | ||
sqlite-interactive | ||
|
||
# editors | ||
emacs | ||
helix | ||
neovim | ||
|
||
# utilities | ||
ripgrep | ||
fd | ||
|
||
# system introspection | ||
hdparm | ||
htop | ||
iotop | ||
lm_sensors | ||
nvme-cli | ||
smartmontools | ||
sysstat | ||
tcpdump | ||
tmux | ||
]; | ||
}; | ||
|
||
nix.nrBuildUsers = 100; | ||
services.openssh = { | ||
enable = true; | ||
authorizedKeysFiles = lib.mkForce [ "/etc/ssh/authorized_keys.d/%u" ]; | ||
}; | ||
|
||
nix.extraOptions = '' | ||
allowed-impure-host-deps = /etc/protocols /etc/services /etc/nsswitch.conf | ||
allowed-uris = https://github.com/ https://git.savannah.gnu.org/ github: | ||
''; | ||
|
||
# we use networkd | ||
networking.useDHCP = false; | ||
|
||
networking.firewall.enable = true; | ||
networking.firewall.rejectPackets = true; | ||
networking.firewall.allowPing = true; | ||
networking.firewall.allowedTCPPorts = [ 10050 ]; | ||
networking.firewall.logRefusedConnections = false; | ||
networking.firewall = { | ||
enable = true; | ||
|
||
# be a good network citizen and allow some debugging interactions | ||
rejectPackets = true; | ||
allowPing = true; | ||
|
||
# prevent firewall log spam from rotating the kernel rinbuffer | ||
logRefusedConnections = false; | ||
}; | ||
|
||
services.resolved = { | ||
enable = true; | ||
|
@@ -84,37 +91,10 @@ with lib; | |
]; | ||
}; | ||
|
||
# Bump the open files limit so that non-root users can run NixOS VM | ||
# tests (Samba opens lot of files). | ||
security.pam.loginLimits = [ | ||
{ | ||
domain = "*"; | ||
item = "nofile"; | ||
type = "-"; | ||
value = "16384"; | ||
} | ||
]; | ||
|
||
# Enable Kernel Samepage Merging (reduces memory footprint of VMs). | ||
hardware.ksm.enable = true; | ||
|
||
# Disable the systemd-journald watchdog. The default timeout (1min) | ||
# can easily be triggered on our slow, heavily-loaded disks. And | ||
# that may cause services writing to the journal to fail until | ||
# they're restarted. | ||
systemd.services.systemd-journald.serviceConfig.WatchdogSec = 0; | ||
|
||
environment.enableDebugInfo = true; | ||
|
||
systemd.tmpfiles.rules = [ "d /tmp 1777 root root 7d" ]; | ||
|
||
# Disable sending email from cron. | ||
services.cron.mailto = ""; | ||
|
||
documentation.nixos.enable = false; | ||
|
||
security.acme.acceptTerms = true; | ||
security.acme.defaults.email = "[email protected]"; | ||
security.acme = { | ||
acceptTerms = true; | ||
defaults.email = "[email protected]"; | ||
}; | ||
|
||
services.zfs.autoScrub.enable = true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my experience this is not advisable at all and causes random reboots once every day or two.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have just refactored this, the infra has been running with this for years. And personally I cannot confirm such a behavior either.