Hey everyone,
I recently moved to flakes, but no matter what I do, NixOS keeps rebuilding over 1000 packages from source (which will take a few days, even on my beefy processor) despite Hydra already having binary substitutes for those packages.
With the following flake.nix
:
{
description = "NixOS System Configuration";
inputs = {
nixpkgs = { url = "github:NixOS/nixpkgs?rev=16448f9e76cf207a331e397b33b3e059b81fce0d"; };
nur = { url = "github:nix-community/NUR"; };
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs@{ nixpkgs, home-manager, nur, ... }:
{
nix.registry.nixpkgs.flake = nixpkgs;
nixosConfigurations = {
laptop = inputs.nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.prim = import ./home/prim/home.nix;
}
];
specialArgs = { inherit inputs; };
};
};
};
}
yields to:
[15/33/1237 built, 5/34/43 copied (1036.4/1743.8 MiB), 544.0/755.0 MiB DL] building ghostscript-with-X-9.56.1
despite ghostscript and all most other mentioned packages being available on cache.nixos.org
(notice the revision of nixpkgs, this is from 8 days ago, but even if I use nixos-unstable it rebuilds everything from source)
The following nix config is in place (default):
accept-flake-config = false
access-tokens =
allow-dirty = true
allow-import-from-derivation = true
allow-new-privileges = false
allow-symlinked-store = false
allow-unsafe-native-code-during-evaluation = false
allowed-impure-host-deps =
allowed-uris =
allowed-users = *
auto-optimise-store = true
bash-prompt =
bash-prompt-prefix =
bash-prompt-suffix =
build-hook = /nix/store/gi0aq6w348vfxs3ggxl9jpg25ixp44kd-nix-2.11.0/bin/nix __build-remote
build-poll-interval = 5
build-users-group = nixbld
builders =
builders-use-substitutes = false
commit-lockfile-summary =
compress-build-log = true
connect-timeout = 0
cores = 0
diff-hook =
download-attempts = 5
download-speed = 0
enforce-determinism = true
eval-cache = true
experimental-features = flakes nix-command
extra-platforms = aarch64-linux i686-linux
fallback = false
filter-syscalls = true
flake-registry = https://channels.nixos.org/flake-registry.json
fsync-metadata = true
gc-reserved-space = 8388608
hashed-mirrors =
http-connections = 25
http2 = true
ignore-try = false
ignored-acls = security.csm security.selinux system.nfs4_acl
impersonate-linux-26 = false
keep-build-log = true
keep-derivations = true
keep-env-derivations = false
keep-failed = false
keep-going = false
keep-outputs = false
log-lines = 10
max-build-log-size = 0
max-free = 18446744073709551615
max-jobs = 20
max-silent-time = 0
min-free = 0
min-free-check-interval = 5
nar-buffer-size = 33554432
narinfo-cache-negative-ttl = 3600
narinfo-cache-positive-ttl = 2592000
netrc-file = /etc/nix/netrc
nix-path = nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos nixos-config=/etc/nixos/configuration.nix /nix/var/nix/profiles/per-user/root/channels
plugin-files =
post-build-hook =
pre-build-hook =
preallocate-contents = false
print-missing = true
pure-eval = true
repeat = 0
require-sigs = true
restrict-eval = false
run-diff-hook = false
sandbox = true
sandbox-build-dir = /build
sandbox-dev-shm-size = 50%
sandbox-fallback = false
sandbox-paths = /bin/sh=/nix/store/b0ypzsib8ymwgi9a7rl3m4fxni83wdai-busybox-static-x86_64-unknown-linux-musl-1.35.0/bin/busybox /nix/store/wisbr6daj4ih1751wylkhf66bxfww9rs-qemu-aarch64-binfmt-P-x86_64-unknown-linux-musl /run/binfmt
secret-key-files =
show-trace = false
stalled-download-timeout = 300
store = auto
substitute = true
substituters = https://cache.nixos.org/
sync-before-registering = false
system = x86_64-linux
system-features = benchmark big-parallel kvm nixos-test
tarball-ttl = 3600
timeout = 0
trace-function-calls = false
trace-verbose = false
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
trusted-substituters =
trusted-users = root
use-case-hack = false
use-registries = true
use-sqlite-wal = true
user-agent-suffix =
warn-dirty = true