mirror of
https://github.com/input-output-hk/devx.git
synced 2024-09-11 04:15:30 +03:00
Revision (input-output-hk/devx): 0a5cefb55c
.
/nix/store/2nigzj6x6d0qkzqvvyf5604g0581r8z6-ghc810-env.sh: line 1937: CODESPACE_TOKEN: unbound variable
CABAL_DIR set to /Users/runner/.cabal-devx
Notice: Hint: to reproduce this environment locally, use either: `nix develop github:input-output-hk/devx#ghc8107`, or `docker run -it -v $(pwd):/workspaces ghcr.io/input-output-hk/devx-devcontainer:x86_64-linux.ghc8107`
40 lines
1.4 KiB
Nix
40 lines
1.4 KiB
Nix
{ pkgs, static ? false }: rec {
|
|
CABAL_PROJECT_LOCAL_TEMPLATE = with pkgs; ''
|
|
package digest
|
|
${if static then "extra-lib-dirs: ${zlib}/lib ${pcre}/lib" else ""}
|
|
constraints:
|
|
HsOpenSSL +use-pkg-config,
|
|
zlib +pkg-config,
|
|
pcre-lite +pkg-config
|
|
'';
|
|
template = pkgs.writeTextFile {
|
|
name = "cabal.project.local";
|
|
text = CABAL_PROJECT_LOCAL_TEMPLATE;
|
|
};
|
|
shellHook = ''
|
|
echo "Quirks:"
|
|
echo -e "\tif you have the zlib, HsOpenSSL, or digest package in your dependency tree, please make sure to"
|
|
echo -e "\tcat ${template} >> cabal.project.local"
|
|
function patchProjectLocal() {
|
|
cat ${template} >> "$1"
|
|
}
|
|
echo ""
|
|
'';
|
|
hint = flavor: ''
|
|
if [ "$GITHUB_ACTIONS" = "true" ]; then
|
|
PREFIX="::notice::Hint:"
|
|
else
|
|
PREFIX="Hint:"
|
|
fi
|
|
if [ "$GITHUB_ACTIONS" = "true" ] || [ -v CODESPACE_TOKEN ]; then
|
|
echo "$PREFIX to reproduce this environment locally, use either:" \
|
|
"\`nix develop github:input-output-hk/devx#${flavor}\`, or" \
|
|
"\`docker run -it -v \$(pwd):/workspaces ghcr.io/input-output-hk/devx-devcontainer:x86_64-linux.${flavor}\`"
|
|
fi
|
|
if [ -v CODESPACE_TOKEN ]; then
|
|
echo "Quirks:"
|
|
echo -e "\tThe Haskell VSCode extension might ask you \"How do you want the extension to manage/discover HLS and the relevant toolchain?\""
|
|
echo -e "\tChoose \"Manually via PATH\", not \"Automatically via GHCup\""
|
|
fi
|
|
'';
|
|
} |