on iko/ghcjs-patch-master help sign in
Enable non-flake imports to work in pure-eval mode.
commit7215f083b37741446aa325b20c8ba9f9f76015eb authorShea Levy <shea@shealevy.com> dateThu 19 Aug 2021, 09:47 (5 years ago) parent53fff53
1 file changed+9−2
default.nix+9−2
default.nix+9−2
@@ -6,12 +6,19 @@ let
66 url = "https://github.com/NixOS/nixpkgs/archive/3c6f3f84af60a8ed5b8a79cf3026b7630fcdefb8.tar.gz";
77 sha256 = "sha256:0jf9l6j60sa8cms7r4a02kr9j9884pwv1prf79b2ysnxmnhimnch";
88 };
9− pkgs = args.pkgs or import nixpkgsSrc {};
9+ pkgs = args.pkgs or (import nixpkgsSrc {});
1010 flake-compat =
1111 pkgs.fetchzip {
1212 url = "https://github.com/hamishmack/flake-compat/archive/ce16b21b8a5588aa8b532353d3ceea89a38b8e77.tar.gz";
1313 sha256 = "sha256:054nsfqh3wy6v6bjamw0k91xl8v1rc5x2laic8mphrkrhzvyz5hi";
1414 };
15− self = import flake-compat { src = ./.; inherit pkgs; };
15+ self = import flake-compat {
16+ # This is a workaround for https://github.com/edolstra/flake-compat/issues/25:
17+ # If we're in pure-eval mode (signified by lack of builtins.currentSystem), then we
18+ # bypass flake-compat's rootSrc cleaning by evading its detection of this as a git
19+ # repo
20+ src = if builtins ? currentSystem then ./. else { outPath = ./.; };
21+ inherit pkgs;
22+ };
1623in self.defaultNix // (self.defaultNix.internal.compat
1724({ system = args.pkgs.system or builtins.currentSystem; } // args))