如何禁用 nix-env 的二进制缓存?

如何禁用 nix-env 的二进制缓存?

我试图弄清楚 nix-serve / nix 二进制缓存。

在某个时候我补充道:

  nix = {
    binaryCaches = [
      "https://cache.nixos.org/"
      "http://127.0.0.1:8899"
    ];
    binaryCachePublicKeys = [
      "my-nix-cache:z3o8Kf/PTzehVpMsE2KoYyf5rkU/XCR0+AfEvtKSgo8="
    ];
    trustedUsers = [ "root" "chris" ];
  };

127.0.0.1然后我删除了+ ran的条目nixos-rebuild switch

但是每次我尝试使用nix-env时,它仍然尝试用作127.0.0.1:8899二进制缓存......

我怎样才能删除它/禁用它?

nix-env -i i3     
warning: name collision in input Nix expressions, skipping '/home/chris/.nix-defexpr/channels_root/nixos'
warning: name collision in input Nix expressions, skipping '/home/chris/.nix-defexpr/channels_root/unstable'
installing 'i3-4.16.1'
warning: unable to download 'http://127.0.0.1:8899/09v6jr8gr9g50fm71yamspisi01g9b2d.narinfo': Couldn't connect to server (7); retrying in 324 ms
warning: unable to download 'http://127.0.0.1:8899/fnak72l1m3bci5qfn5719h1jzw2wjsdz.narinfo': Couldn't connect to server (7); retrying in 303 ms
warning: unable to download 'http://127.0.0.1:8899/fnak72l1m3bci5qfn5719h1jzw2wjsdz.narinfo': Couldn't connect to server (7); retrying in 520 ms
warning: unable to download 'http://127.0.0.1:8899/09v6jr8gr9g50fm71yamspisi01g9b2d.narinfo': Couldn't connect to server (7); retrying in 621 ms
warning: unable to download 'http://127.0.0.1:8899/fnak72l1m3bci5qfn5719h1jzw2wjsdz.narinfo': Couldn't connect to server (7); retrying in 1346 ms
warning: unable to download 'http://127.0.0.1:8899/09v6jr8gr9g50fm71yamspisi01g9b2d.narinfo': Couldn't connect to server (7); retrying in 1046 ms
warning: unable to download 'http://127.0.0.1:8899/09v6jr8gr9g50fm71yamspisi01g9b2d.narinfo': Couldn't connect to server (7); retrying in 2506 ms
warning: unable to download 'http://127.0.0.1:8899/fnak72l1m3bci5qfn5719h1jzw2wjsdz.narinfo': Couldn't connect to server (7); retrying in 2528 ms

答案1

删除~/.config/nix/nix.conf为我解决了这个问题(但我不知道它是如何创建的)。

也许我本可以删除该条目,127.0.0.1:8899但我很懒。

substituters = https://cache.nixos.org https://cache.nixos.org/ https://hydra.iohk.io http://127.0.0.1:8899 ...
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= ...

相关内容