Repository navigation
Closed
Description
In NixOS, when using the following command line as root:
nixos-rebuild switch --option binary-caches "http://cache.nixos.org" -I /home/wizeman/nixos-dev/
or even:
nixos-rebuild switch --option trusted-binary-caches "http://cache.nixos.org" --option binary-caches "http://cache.nixos.org" -I /home/wizeman/nixos-dev/
I got the following error:
building the system configuration...
error: substituter `/nix/store/sxhiwkydfwcvsm77splhzlda63p8l5cv-nix-1.5.2/libexec/nix/substituters/download-from-binary-cache.pl' failed: binary cache ‘http://cache.nixos.org’ is not trusted (please add it to ‘trusted-binary-caches’ [http://nixos.org/binary-cache] in /etc/nix/nix.conf)
I don't have any special "nix.*" option in configuration.nix, and NIX_REMOTE is empty.
The way to reproduce it is somewhat complicated:
- Make sure you don't have any "nix.*" option in configuration.nix, or any non-default setting in /etc/nix/nix.conf
- Make sure that you are root and that NIX_REMOTE is empty
- Make your changes effective and simulate that nixos.org is down (so that you want to use a different binary cache):
nixos-rebuild switch
route add -host nixos.org reject
- Remove some package from your environment.systemPackages in configuration.nix
- Run:
nix-collect-garbage -d
- Now try to make your change effective by doing:
nixos-rebuild switch --option binary-caches "http://cache.nixos.org"
Most likely, you will get the error above.
Metadata
Metadata
Assignees
Labels
No labels
Activity
wizeman commentedon May 31, 2013
BTW, the workaround I used was to run "nixos-rebuild switch" without "--option binary-caches", waiting for the download to fail, then in another console I ran (as a user):
(... of course, replacing "patchelf" by whatever package was failing to download).
Then I went back to running "nixos-rebuild switch" without any option, and cyclically did this until I downloaded all necessary files and "nixos-rebuild switch" wouldn't need to download any more.
Finally, I set the following in configuration.nix:
@ldesgoui has signed the CLA from Pull Request NixOS#127
Merge pull request NixOS#127 from ldesgoui/patch-1
Merge pull request NixOS#127 from DeterminateSystems/eelcodolstra/fh-…
doc/inventory/candidates: cross-reference cleanup branches
nix/run: tidy chrootHelper preprocessor guards and chrootHelperName
doc/inventory: STATUS — record bidirectional audit + orphan-commit fi…