Skip to content

nixos/misc: Fix nixpkgs.config merge function#66450

Merged
infinisil merged 1 commit intoNixOS:masterfrom
infinisil:fix-nixpkgs.config-type
Aug 10, 2019
Merged

nixos/misc: Fix nixpkgs.config merge function#66450
infinisil merged 1 commit intoNixOS:masterfrom
infinisil:fix-nixpkgs.config-type

Conversation

@infinisil
Copy link
Member

Motivation for this change

Previously nested attrsets would override each other

With this module:

{ lib, ... }: {

  nixpkgs.config = lib.mkMerge [
    { foo.bar = true; }
    { foo.baz = true; }
  ];

}

Before it would evaluate to

{ foo = { baz = true; }; }

Now it evaluates to

{ foo = { bar = true; baz = true; }; }

Fixes a problem #66448 tries to workaround

Previously nested attrsets would override each other
@ofborg ofborg bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Aug 10, 2019
Copy link
Contributor

@bkchr bkchr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can confirm that this works :)

@infinisil infinisil merged commit 5c7afdd into NixOS:master Aug 10, 2019
@infinisil infinisil deleted the fix-nixpkgs.config-type branch August 10, 2019 19:01
@infinisil
Copy link
Member Author

Backported to 19.03 in 68dd778 as well

@SomeoneSerge
Copy link
Contributor

@infinisil Hiii, coming here from #456510... yours was the most recent to touch the merge function, is there some obvious reason we can't do extendModules?

@infinisil
Copy link
Member Author

Just a guess, but it could be that extendModules didn't exist back then!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants