Skip to content

Commit

Permalink
Patch stacklock2nix to download all refs when fetching git package de…
Browse files Browse the repository at this point in the history
…ps (#376)

Temporary fix for
cdepillabout/stacklock2nix#38, until this is
(hopefully) fixed upstream
  • Loading branch information
goodlyrottenapple authored Nov 20, 2023
1 parent 27ac540 commit 62139cd
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
15 changes: 14 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,24 @@
let
perSystem = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
nixpkgsCleanFor = system: import nixpkgs { inherit system; };

# temporary fix for https://github.com/cdepillabout/stacklock2nix/issues/38
stacklock2nix-patched = system: (nixpkgsCleanFor system).stdenvNoCC.mkDerivation {
name = "stacklock2nix-patched";
src = stacklock2nix;
dontBuild = true;
patches = [ ./stacklock2nix.patch ];
installPhase = ''
mkdir $out
cp -r nix/* $out/
'';
};

nixpkgsFor = system:
import nixpkgs {
inherit system;
overlays =
[ stacklock2nix.overlay self.overlay haskell-backend.overlays.z3 ];
[ (import "${(stacklock2nix-patched system)}/overlay.nix") self.overlay haskell-backend.overlays.z3 ];
};
withZ3 = pkgs: pkg: exe:
pkgs.stdenv.mkDerivation {
Expand Down
12 changes: 12 additions & 0 deletions stacklock2nix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/nix/build-support/stacklock2nix/default.nix b/nix/build-support/stacklock2nix/default.nix
index b13f246..116ca11 100644
--- a/nix/build-support/stacklock2nix/default.nix
+++ b/nix/build-support/stacklock2nix/default.nix
@@ -380,6 +380,7 @@ let
url = haskPkgLock.git;
name = srcName;
rev = haskPkgLock.commit;
+ allRefs = true;
};
src =
if haskPkgLock ? "subdir" then

0 comments on commit 62139cd

Please sign in to comment.