`nix build` trying to build basic tools for all packages from scratch

I’m attempting to run nix build on a simple hello-world flake (the one from tweag’s post https://www.tweag.io/blog/2020-05-25-flakes/), and nix is trying to build/configure very basic tools like gettext, perl, and gcc from scratch, resulting in a very long build time which it has yet to complete successfully (it usually dies at some point in the process).

I assume this has something to do with this warning I get while attempting to build the flake:

warning: ignoring untrusted substituter 'https://cache.nixos.org'

I found one github issue mentioning a message similar to that, but it’s from a couple years ago, so I’m tentative.

Anyone run into this before/know how to fix it?

1 Like

What’s your output for nix show-config?

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 = false
bash-prompt = 
bash-prompt-suffix = 
build-hook = /nix/store/dgj3wgjbv58rwxvshvv8mhasw931d53a-nix-2.4pre20201201_5a6ddb3/libexec/nix/build-remote
build-poll-interval = 5
build-users-group = nixbld
builders = 
builders-use-substitutes = false
compress-build-log = true
connect-timeout = 0
cores = 0
diff-hook = 
download-attempts = 5
enforce-determinism = true
eval-cache = true
experimental-features = nix-command flakes ca-references
extra-platforms = i686-linux
fallback = false
filter-syscalls = true
flake-registry = https://github.com/NixOS/flake-registry/raw/master/flake-registry.json
fsync-metadata = true
gc-reserved-space = 8388608
hashed-mirrors = 
http-connections = 25
http2 = true
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 = 4
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 = /home/dot/.nix-defexpr/channels 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/rr86zzz4jf8385x0l6lllc7wkxy16z8n-busybox-1.31.1-x86_64-unknown-linux-musl/bin/busybox
secret-key-files = 
show-trace = false
stalled-download-timeout = 300
store = auto
substitute = true
substituters = https://cache.nixos.org https://mjlbach.cachix.org https://nix-community.cachix.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
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= mjlbach.cachix.org-1:dR0V90mvaPbXuYria5mXvnDtFibKYqYc2gtl9MWSkqI= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
trusted-substituters = 
trusted-users = root
use-case-hack = false
use-sqlite-wal = true
user-agent-suffix = 
warn-dirty = true

mjlbach helped me out in the Discord, so I’ll write what worked for me here just in case someone else ever encounters the same issue: I needed to add my user to the list of trusted-users. You can do this via adding nix.trustedUsers = [ "root" "my-username" ]; in your configuration.nix file and running nixos-rebuild switch.

6 Likes
Hosted by Flying Circus.