Fix non-flake compatibility layer. (#1204)

Previously 'overlays' was being taken from the non-compat flake output
and nixpkgsArgs referenced the wrong version.

Fixes #1192
This commit is contained in:
Shea Levy 2021-08-16 08:08:42 -04:00 committed by GitHub
parent c87907aca6
commit 1729233076
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View File

@ -13,5 +13,5 @@ let
sha256 = "sha256:054nsfqh3wy6v6bjamw0k91xl8v1rc5x2laic8mphrkrhzvyz5hi"; sha256 = "sha256:054nsfqh3wy6v6bjamw0k91xl8v1rc5x2laic8mphrkrhzvyz5hi";
}; };
self = import flake-compat { src = ./.; inherit pkgs; }; self = import flake-compat { src = ./.; inherit pkgs; };
in self.defaultNix.internal.compat in self.defaultNix // (self.defaultNix.internal.compat
({ system = args.pkgs.system or builtins.currentSystem; } // args) // self.defaultNix ({ system = args.pkgs.system or builtins.currentSystem; } // args))

View File

@ -73,8 +73,11 @@
false # Allows us to easily switch on materialization checking false # Allows us to easily switch on materialization checking
, system, sourcesOverride ? { }, ... }@args: rec { , system, sourcesOverride ? { }, ... }@args: rec {
sources = inputs // sourcesOverride; sources = inputs // sourcesOverride;
allOverlays = import ./overlays args; allOverlays = import ./overlays (args // { inherit sources; });
inherit config nixpkgsArgs; inherit config;
# We are overriding 'overlays' and 'nixpkgsArgs' from the
# flake outputs so that we can incorporate the args passed
# to the compat layer (e.g. sourcesOverride).
overlays = [ allOverlays.combined ] overlays = [ allOverlays.combined ]
++ (if checkMaterialization == true then ++ (if checkMaterialization == true then
[ [
@ -86,6 +89,9 @@
] ]
else else
[ ]); [ ]);
nixpkgsArgs = {
inherit config overlays;
};
pkgs = import nixpkgs pkgs = import nixpkgs
(nixpkgsArgs // { localSystem = { inherit system; }; }); (nixpkgsArgs // { localSystem = { inherit system; }; });
pkgs-unstable = import nixpkgs-unstable pkgs-unstable = import nixpkgs-unstable