Skip to content

Commit

Permalink
modules/nixos: change some nix.conf settings
Browse files Browse the repository at this point in the history
Reduce the download attempts and timeouts, to allow faster failing in bad connectivity settings rather than hanging (which is currently what Nix is doing). Furthermore, disable `preallocate-contents` as it's largely useless on modern I/O, and actually causes problems with BTRFS' compression.
  • Loading branch information
Frontear committed Nov 14, 2024
1 parent d732191 commit c9df38a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/nixos/programs/nix/module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,20 @@ in {

builders-use-substitutes = true;

connect-timeout = 15;
connect-timeout = 5;
cores = 2;

debugger-on-trace = true;
# debugger-on-warn = true;
download-attempts = 3;
download-attempts = 2;
eval-cache = true;

# It's useful to know when a substitute is failing!
fallback = false;

# Improve the chances of the store surviving a random crash.
fsync-metadata = true;
# fsync-store-paths = true;
# fsync-store-paths = true; TODO: on next Lix release

# Keeping these is very useful for development.
keep-build-log = true;
Expand All @@ -110,7 +110,7 @@ in {
max-jobs = "auto";
min-free = 10 * 1024 * 1024 * 1024;

preallocate-contents = true;
preallocate-contents = false; # Unnecessary on modern I/O

# Never allow a non-sandboxed build
sandbox-fallback = false;
Expand Down

0 comments on commit c9df38a

Please sign in to comment.