Skip to content

Commit

Permalink
Merge pull request #142 from nix-community/sane-nix-settings
Browse files Browse the repository at this point in the history
add nix-settings from srvos
  • Loading branch information
Mic92 authored Nov 20, 2023
2 parents b75f16f + 971b684 commit 4dcc041
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nix/installer.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
# for zapping of disko
environment.systemPackages = [ pkgs.jq ];

imports = [
./nix-settings.nix
];

systemd.services.log-network-status = {
wantedBy = [ "multi-user.target" ];
# No point in restarting this. We just need this after boot
Expand Down
28 changes: 28 additions & 0 deletions nix/nix-settings.nix
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 4dcc041

Please sign in to comment.