Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 804678f9ea52
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c7ade6844f4c
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Jan 3, 2020

  1. Revert "lib/types: Allow paths as submodule values"

    This reverts commit eec83d4.
    
    This broke hydra evaluation because with this commit submodule values
    are allowed to be paths, however the certmgr module uses `either
    (submodule ...) path` in its type, meaning it already used paths for
    something else which would now be interpreted as a submodule.
    infinisil committed Jan 3, 2020
    Copy the full SHA
    c7ade68 View commit details
Showing with 6 additions and 8 deletions.
  1. +3 −5 lib/types.nix
  2. +3 −3 nixos/doc/manual/development/option-types.xml
8 changes: 3 additions & 5 deletions lib/types.nix
Original file line number Diff line number Diff line change
@@ -376,16 +376,14 @@ rec {
else unify (if shorthandOnlyDefinesConfig then { config = value; } else value);

allModules = defs: modules ++ imap1 (n: { value, file }:
if isAttrs value || isFunction value then
# Annotate the value with the location of its definition for better error messages
coerce (lib.modules.unifyModuleSyntax file "${toString file}-${toString n}") value
else value
# Annotate the value with the location of its definition for better error messages
coerce (lib.modules.unifyModuleSyntax file "${toString file}-${toString n}") value
) defs;

in
mkOptionType rec {
name = "submodule";
check = x: isAttrs x || isFunction x || path.check x;
check = x: isAttrs x || isFunction x;
merge = loc: defs:
(evalModules {
modules = allModules defs;
6 changes: 3 additions & 3 deletions nixos/doc/manual/development/option-types.xml
Original file line number Diff line number Diff line change
@@ -257,9 +257,9 @@
<listitem>
<para>
A set of sub options <replaceable>o</replaceable>.
<replaceable>o</replaceable> can be an attribute set, a function
returning an attribute set, or a path to a file containing such a value. Submodules are used in
composed types to create modular options. This is equivalent to
<replaceable>o</replaceable> can be an attribute set or a function
returning an attribute set. Submodules are used in composed types to
create modular options. This is equivalent to
<literal>types.submoduleWith { modules = toList o; shorthandOnlyDefinesConfig = true; }</literal>.
Submodules are detailed in
<xref