aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/etc
diff options
context:
space:
mode:
authorLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2026-05-13 13:43:40 +0100
committerLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2026-05-13 13:43:40 +0100
commit26fc82ade8e6fde6858df1ed53bafa64719f2f15 (patch)
tree8b23621412566e494e0a485321b67255009008fb /etc
parentab8ee06cbfce42f94e07a0a694701a4df9201815 (diff)
downloaddotfiles-26fc82ade8e6fde6858df1ed53bafa64719f2f15.tar.gz
dotfiles-26fc82ade8e6fde6858df1ed53bafa64719f2f15.tar.bz2
dotfiles-26fc82ade8e6fde6858df1ed53bafa64719f2f15.zip
feat(nix): saturate builds, add community cache, pin nixpkgs registry
- Drop auto-optimise-store: slows every build for modest disk savings. Run 'nix store optimise' manually if disk pressure ever shows up. - max-jobs=auto, cores=0: defaults are 1/1, which left most of the box idle during large closures (LLVM, protobuf, …). - Add nix-community.cachix.org as an extra substituter with its public key. Big hit-rate boost against nixos-unstable, which is what the new user registry points 'nixpkgs' at. - dot_config/nix/registry.json pins 'nixpkgs' indirect ref to github:NixOS/nixpkgs/nixos-unstable, so 'nix shell nixpkgs#foo' is fast + reproducible. Project flakes are unaffected — they pin their own inputs via flake.lock.
Diffstat (limited to 'etc')
-rw-r--r--etc/nix/nix.conf12
1 files changed, 10 insertions, 2 deletions
diff --git a/etc/nix/nix.conf b/etc/nix/nix.conf
index 633422b..3325961 100644
--- a/etc/nix/nix.conf
+++ b/etc/nix/nix.conf
@@ -12,8 +12,10 @@ experimental-features = nix-command flakes
# the daemon prompting. Safe on a single-user laptop.
trusted-users = root @wheel
-# Hard-link identical store paths to save disk after large builds.
-auto-optimise-store = true
+# Use every core for every build. Defaults are 1/1, which leaves most of
+# the machine idle during big closures (LLVM, protobuf, …).
+max-jobs = auto
+cores = 0
# Keep build outputs and derivations alive even when only referenced
# from GC roots like direnv envs. Without these, `nix store gc` would
@@ -23,3 +25,9 @@ keep-derivations = true
# Lift the default 64 MiB download buffer; reduces stalls on big closures.
download-buffer-size = 524288000
+
+# Community-built binary cache. Big hit-rate boost for nixos-unstable
+# packages (which is what the registry pin below points at) and for
+# anything pulled from nixpkgs that already has community CI coverage.
+extra-substituters = https://nix-community.cachix.org
+extra-trusted-public-keys = nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=