Skip to content

Commit f7adf1a

Browse files
committed
Fix path logic
1 parent 7595b61 commit f7adf1a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

overlays/haskell.nix

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,8 +755,10 @@ final: prev: {
755755
} // final.lib.optionalAttrs (p.pkg-src.type or "" == "local") {
756756
src = if final.lib.hasPrefix "/" p.pkg-src.path
757757
then p.pkg-src.path
758-
else callProjectResults.src + final.lib.removePrefix ".${callProjectResults.src.origSubDir or ""}"
759-
(final.lib.removePrefix ".${callProjectResults.src.origSubDir or ""}/." p.pkg-src.path);
758+
else callProjectResults.src + final.lib.removeSuffix "/." (
759+
if final.lib.hasPrefix ".${callProjectResults.src.origSubDir or ""}/" (p.pkg-src.path + "/")
760+
then final.lib.removePrefix ".${callProjectResults.src.origSubDir or ""}" p.pkg-src.path
761+
else throw "Unexpected path ${p.pkg-src.path} expected it to start with .${callProjectResults.src.origSubDir or ""}");
760762
} // {
761763
flags = p.flags;
762764
components = getComponents cabal2nix.components hsPkgs p;

0 commit comments

Comments
 (0)