diff options
author | Robert Hensing <robert@roberthensing.nl> | 2023-05-17 12:51:09 +0200 |
---|---|---|
committer | Robert Hensing <robert@roberthensing.nl> | 2023-05-17 12:51:09 +0200 |
commit | 2e485f2581810ad51636cd6950bbc62eb4aaa16b (patch) | |
tree | 588175b6244d2aaf3488529e078273f5ff3c3fbe | |
parent | 8d67bb4aa7d442e3c621b26824f65d95ef1fb5e4 (diff) | |
download | nixpkgs-2e485f2581810ad51636cd6950bbc62eb4aaa16b.tar nixpkgs-2e485f2581810ad51636cd6950bbc62eb4aaa16b.tar.gz nixpkgs-2e485f2581810ad51636cd6950bbc62eb4aaa16b.tar.bz2 nixpkgs-2e485f2581810ad51636cd6950bbc62eb4aaa16b.tar.lz nixpkgs-2e485f2581810ad51636cd6950bbc62eb4aaa16b.tar.xz nixpkgs-2e485f2581810ad51636cd6950bbc62eb4aaa16b.tar.zst nixpkgs-2e485f2581810ad51636cd6950bbc62eb4aaa16b.zip |
lib.types.submoduleWith: Interoperate with older version of submoduleWith
-rw-r--r-- | lib/types.nix | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/types.nix b/lib/types.nix index 373d0ce7876..9360d42f585 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -775,9 +775,11 @@ rec { }; binOp = lhs: rhs: { class = - if lhs.class == null then rhs.class - else if rhs.class == null then lhs.class - else if lhs.class == rhs.class then lhs.class + # `or null` was added for backwards compatibility only. `class` is + # always set in the current version of the module system. + if lhs.class or null == null then rhs.class or null + else if rhs.class or null == null then lhs.class or null + else if lhs.class or null == rhs.class then lhs.class or null else throw "A submoduleWith option is declared multiple times with conflicting class values \"${toString lhs.class}\" and \"${toString rhs.class}\"."; modules = lhs.modules ++ rhs.modules; specialArgs = |