Skip to content

Commit c6e7fa3

Browse files
committed
Fix nix build on macOS
1 parent dacab03 commit c6e7fa3

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

nix/overlay.nix

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,16 @@ in
145145
final.spago
146146
prev.purescript
147147
];
148-
buildPhase = "spago build";
148+
buildPhase = ''
149+
# mkSpagoDerivation places the registry cache at the Linux path
150+
# ($HOME/.cache/spago-nodejs), but on macOS Spago looks at
151+
# $HOME/Library/Caches/spago-nodejs. Symlink to fix.
152+
if [ "$(uname)" = "Darwin" ] && [ -d "$HOME/.cache/spago-nodejs" ]; then
153+
mkdir -p "$HOME/Library/Caches"
154+
ln -s "$HOME/.cache/spago-nodejs" "$HOME/Library/Caches/spago-nodejs"
155+
fi
156+
spago build
157+
'';
149158
installPhase = "mkdir $out; cp -r * $out";
150159
};
151160

0 commit comments

Comments
 (0)