forked from NixOS/nixpkgs
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkgs/top-level: introduce
configs
argument and marry `nixpkgs.confi…
…g` of NixOS to it This types `nixpkgs.config` of NixOS with `types.opaque` type and applies the resulting evaluated value to the newly introduced `configs` argument of `pkgs`. The new `configs` argument is like the old `config` argument (still available for convenience) but a list. This design was chosen because we can't just make a submodule out of `pkgs/top-level/config.nix` in NixOS because - firstly, we would have to duplicate all the magic `pkgs/top-level/default.nix` does to `config` in NixOS, - secondly, in principle, we might not have all the arguments needed by `pkgs/top-level/config.nix` in NixOS because some of them can be computed internally by `pkgs` (this is not a problem now but it will be a problem in use-flags patchset that comes after), thus all of those computations will need to be duplicated too, - thirdly, doing it this way keeps NixOS and pkgs separated, so that, in principle, one could replace NixOS with an alternative thing without duplicating all of the above once again and/or one could use separate module and type systems between NixOS and pkgs (`types.opaque` is trivial to implement in any type system and pkgs can use "types-simple" of NixOS#37252 today, if we were to wish it so). Note that since this design removes the need to do any preprocessing of `nixpkgs.config` in NixOS all the ad-hoc merging code was removed. Yay!
- Loading branch information
Showing
4 changed files
with
57 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters