add nix-settings from srvos

if used as a recovery system, it's useful to have flakes etc enabled.
This commit is contained in:
Jörg Thalheim 2023-11-19 13:23:42 +01:00
parent b75f16f72f
commit 971b6849d5
2 changed files with 32 additions and 0 deletions

View file

@ -23,6 +23,10 @@
# for zapping of disko # for zapping of disko
environment.systemPackages = [ pkgs.jq ]; environment.systemPackages = [ pkgs.jq ];
imports = [
./nix-settings.nix
];
systemd.services.log-network-status = { systemd.services.log-network-status = {
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
# No point in restarting this. We just need this after boot # No point in restarting this. We just need this after boot

28
nix/nix-settings.nix Normal file
View file

@ -0,0 +1,28 @@
# take from srvos
{ lib, ... }:
{
# Fallback quickly if substituters are not available.
nix.settings.connect-timeout = 5;
# Enable flakes
nix.settings.experimental-features = [
"nix-command"
"flakes"
"repl-flake"
];
# The default at 10 is rarely enough.
nix.settings.log-lines = lib.mkDefault 25;
# Avoid disk full issues
nix.settings.max-free = lib.mkDefault (3000 * 1024 * 1024);
nix.settings.min-free = lib.mkDefault (512 * 1024 * 1024);
# TODO: cargo culted.
nix.daemonCPUSchedPolicy = lib.mkDefault "batch";
nix.daemonIOSchedClass = lib.mkDefault "idle";
nix.daemonIOSchedPriority = lib.mkDefault 7;
# Avoid copying unnecessary stuff over SSH
nix.settings.builders-use-substitutes = true;
}