Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typed nixpkgs.config married to NixOS #57123

Closed
wants to merge 12 commits into from

Commits on Mar 8, 2019

  1. check-meta.nix: move options to config.nix

    This also makes "Unfree" and "Insecure" options homogenous.
    oxij committed Mar 8, 2019
    Configuration menu
    Copy the full SHA
    4e99024 View commit details
    Browse the repository at this point in the history
  2. lib: resurrect types.functionTo

    This reverts commit 4ff1ab5.
    
    This type was removed because it usually implies a bad design. However, since that
    commit NixOS modules that can't live without it implemented several ugly ad-hoc
    replacements for it while other modules that could make a good use of it
    simply suffer. See the following commits.
    oxij committed Mar 8, 2019
    Configuration menu
    Copy the full SHA
    fbf0f8d View commit details
    Browse the repository at this point in the history

Commits on Mar 13, 2019

  1. Configuration menu
    Copy the full SHA
    6d3fb98 View commit details
    Browse the repository at this point in the history
  2. lib/modules.nix: rename _file -> file in unifyModuleSyntax

    ... and change all of its uses.
    
    Strangely enough, before this `_file` was in the public interface of the module
    system while `file` was used internally by `lib.evalModules` code
    after `lib.unifyModuleSyntax` was applied.
    
    `_file` attribute was introduced in 800f9c2 but
    I see no reason behind having "_" in the name there, all other attrs
    processed by `lib.unifyModuleSyntax` keep their names between its input and output.
    
    On the other hand, renaming `_file` into `file` makes `lib.unifyModuleSyntax`
    accept its own output which is useful in cases when you want to modify
    modules before shoving them into `lib.evalModules` but you don't want to duplicate
    `lib.unifyModuleSyntax`.
    oxij committed Mar 13, 2019
    Configuration menu
    Copy the full SHA
    7b5b2f1 View commit details
    Browse the repository at this point in the history
  3. lib/modules.nix: make unifyModuleSyntax idempotent

    The previous commit made it accept its own output, this also makes it
    idempotent.
    oxij committed Mar 13, 2019
    Configuration menu
    Copy the full SHA
    1ba7e12 View commit details
    Browse the repository at this point in the history
  4. lib/types.nix: add opaque type

    oxij committed Mar 13, 2019
    Configuration menu
    Copy the full SHA
    2dd1619 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    a1b8e9e View commit details
    Browse the repository at this point in the history
  6. 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!
    oxij committed Mar 13, 2019
    Configuration menu
    Copy the full SHA
    fba8be4 View commit details
    Browse the repository at this point in the history
  7. pkgs/top-level/config.nix: readd haskellPackageOverrides and deprec…

    …ate it
    
    This makes a removal of that attribute in ee1f34e
    less violent. Now it can be properly deprecated using the new infra.
    oxij committed Mar 13, 2019
    Configuration menu
    Copy the full SHA
    52e5e07 View commit details
    Browse the repository at this point in the history

Commits on Mar 14, 2019

  1. !fixup pkgs/top-level: introduce configs argument and marry `nixpkg…

    …s.config` of NixOS to it
    oxij committed Mar 14, 2019
    Configuration menu
    Copy the full SHA
    db77324 View commit details
    Browse the repository at this point in the history
  2. lib/types.nix: add lazyAttrsOf

    oxij committed Mar 14, 2019
    Configuration menu
    Copy the full SHA
    c7d13f0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    bc61a1b View commit details
    Browse the repository at this point in the history