From 0e103b7e10692412d4e5da6a395e68c2488ff8a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Wed, 22 Jan 2025 09:34:37 +0100 Subject: [PATCH] perf: make nix substitutions faster --- flake.nix | 12 ++++-------- modules/programs/nix.nix | 6 +++++- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/flake.nix b/flake.nix index a126049..3903317 100644 --- a/flake.nix +++ b/flake.nix @@ -215,18 +215,14 @@ nixConfig = { extra-substituters = [ - # "https://hyprland.cachix.org" - "https://nix-community.cachix.org" - "https://pre-commit-hooks.cachix.org" - "https://ghostty.cachix.org" - "https://cache.lix.systems" + "https://nix-community.cachix.org?priority=2" + "https://cache.lix.systems?priority=3" + "https://pre-commit-hooks.cachix.org?priority=4" ]; extra-trusted-public-keys = [ - # "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "pre-commit-hooks.cachix.org-1:Pkk3Panw5AW24TOv6kz3PvLhlH8puAsJTBbOPmBo7Rc=" - "ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns=" "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o=" + "pre-commit-hooks.cachix.org-1:Pkk3Panw5AW24TOv6kz3PvLhlH8puAsJTBbOPmBo7Rc=" ]; }; } diff --git a/modules/programs/nix.nix b/modules/programs/nix.nix index 2dfc969..c390d32 100644 --- a/modules/programs/nix.nix +++ b/modules/programs/nix.nix @@ -68,13 +68,17 @@ in settings = { substituters = [ - "https://cache.nixos.org/" + "https://cache.nixos.org?priority=1" ]; trusted-public-keys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" ]; trusted-users = [ "root" "@wheel" ]; + + # https://bmcgee.ie/posts/2023/12/til-how-to-optimise-substitutions-in-nix/ + http-connections = 128; + max-substitution-jobs = 128; }; }; };