3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/nixos
polykernel 34636a8525 nixos/nix-daemon: Fix merging order for substituters option
The `substituters` option in `nix.settings` uses the order
of the substituters listed to define priority. Prior to https://github.com/NixOS/nixpkgs/pull/139075,
the corresponding option `binaryCaches` is declared in the `nix` namespace,
which is guaranteed to be merged last. However, the order of merging isn't
guaranteed in submodules. This cause definitions to be appended to the default
value instead of prepended, breaking backwards compatibility as reported in https://github.com/NixOS/nixpkgs/issues/158356.

The way this is addressed in the module system is with order priorities via
`mkOrder` and sorting definitions before merging. This PR restores the previous
behavior by setting a higher priority to the substituters option defined internally,
thus all definitions with default priority will be merged before it. This was chosen because
the `mkRenamedOption` function does not preserve order priority so users using legacy options do not have
precise control on placement.

This change should suffice for simple configuration, but further revision to the module system
is needed for to make various `mk*` functions  aware of order priorities.
2022-02-12 17:15:31 -05:00
..
doc Merge pull request #157329 from helsinki-systems/feat/nixos-reload-triggers 2022-02-11 23:59:26 +01:00
lib Merge pull request #157329 from helsinki-systems/feat/nixos-reload-triggers 2022-02-11 23:59:26 +01:00
maintainers nixos/nix-daemon: use structural settings 2022-01-26 21:04:50 -05:00
modules nixos/nix-daemon: Fix merging order for substituters option 2022-02-12 17:15:31 -05:00
tests Merge pull request #157329 from helsinki-systems/feat/nixos-reload-triggers 2022-02-11 23:59:26 +01:00
COPYING
default.nix
README
release-combined.nix
release-small.nix
release.nix

*** NixOS ***

NixOS is a Linux distribution based on the purely functional package
management system Nix.  More information can be found at
https://nixos.org/nixos and in the manual in doc/manual.