Configure nix inside the machines
All checks were successful
checks-impure / test (pull_request) Successful in 1m56s
checks / test (pull_request) Successful in 2m16s

Add sane nix defaults for debugging and usability reasons
This commit is contained in:
a-kenji 2023-11-16 14:08:50 +01:00
parent 20cdcbcb44
commit 0604d5a83d
2 changed files with 29 additions and 0 deletions

View File

@ -7,6 +7,7 @@
./meshnamed
./networking.nix
./packages.nix
./nix-settings.nix
inputs.sops-nix.nixosModules.sops
# just some example options. Can be removed later
./vm.nix

View File

@ -0,0 +1,28 @@
{ lib, ... }:
# Taken from:
# https://github.com/nix-community/srvos/blob/main/nixos/common/nix.nix
{
# 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);
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;
}