on iko/ghcjs-patch-master help sign in
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

commit1729233076f84649aee3b98100a378df88cc8675 authorShea Levy <shea@shealevy.com> dateMon 16 Aug 2021, 08:08 (5 years ago) parentc87907a
2 files changed+10−4
default.nix+2−2 flake.nix+8−2
default.nix+2−2
@@ -13,5 +13,5 @@ let
1313 sha256 = "sha256:054nsfqh3wy6v6bjamw0k91xl8v1rc5x2laic8mphrkrhzvyz5hi";
1414 };
1515 self = import flake-compat { src = ./.; inherit pkgs; };
16−in self.defaultNix.internal.compat
17−({ system = args.pkgs.system or builtins.currentSystem; } // args) // self.defaultNix
16+in self.defaultNix // (self.defaultNix.internal.compat
17+({ system = args.pkgs.system or builtins.currentSystem; } // args))
flake.nix+8−2
@@ -73,8 +73,11 @@
7373 false # Allows us to easily switch on materialization checking
7474 , system, sourcesOverride ? { }, ... }@args: rec {
7575 sources = inputs // sourcesOverride;
76− allOverlays = import ./overlays args;
77− inherit config nixpkgsArgs;
76+ allOverlays = import ./overlays (args // { inherit sources; });
77+ inherit config;
78+ # We are overriding 'overlays' and 'nixpkgsArgs' from the
79+ # flake outputs so that we can incorporate the args passed
80+ # to the compat layer (e.g. sourcesOverride).
7881 overlays = [ allOverlays.combined ]
7982 ++ (if checkMaterialization == true then
8083 [
@@ -86,6 +89,9 @@
8689 ]
8790 else
8891 [ ]);
92+ nixpkgsArgs = {
93+ inherit config overlays;
94+ };
8995 pkgs = import nixpkgs
9096 (nixpkgsArgs // { localSystem = { inherit system; }; });
9197 pkgs-unstable = import nixpkgs-unstable