Skip to content

Commit

Permalink
nix.binaryCaches: always set https://cache.nixos.org
Browse files Browse the repository at this point in the history
There are many support questions when people add a new binary cache
and they suddenly lose nixos substitutions.

Most of the users want to keep that, so we're doing a breaking change.

Previously to disable all binary caches one had to do:

  nix.binaryCache = [];

Now the same is possible via:

  nix.binaryCache = lib.mkForce;
  • Loading branch information
domenkozar committed Jun 26, 2019
1 parent e8916cc commit 036728f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nixos/modules/services/misc/nix-daemon.nix
Expand Up @@ -272,10 +272,12 @@ in

binaryCaches = mkOption {
type = types.listOf types.str;
default = [ https://cache.nixos.org/ ];
description = ''
List of binary cache URLs used to obtain pre-built binaries
of Nix packages.
By default https://cache.nixos.org/ is added,
to override it use <literal>lib.mkForce []</literal>.
'';
};

Expand Down Expand Up @@ -386,6 +388,7 @@ in
config = {

nix.binaryCachePublicKeys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" ];
nix.binaryCaches = [ "https://cache.nixos.org/" ];

environment.etc."nix/nix.conf".source = nixConf;

Expand Down

3 comments on commit 036728f

@vaibhavsagar
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that lib.mkForce [] to override?

@domenkozar
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes :)

@vaibhavsagar
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I was confused by the commit message 😄.

Please sign in to comment.