Skip to content

Commit

Permalink
Try to add Gitpod (kowainik#452)
Browse files Browse the repository at this point in the history
* Create .gitpod.yml

* Readme: add Gitpod

* Update README.md

* Update .gitpod.yml

* Update README.md

* Update README.md

* Update .gitpod.yml

* Update .gitpod.yml

* Update README.md

* add button

Co-authored-by: Geoffrey Huntley <[email protected]>

* Update README.md

Co-authored-by: Geoffrey Huntley <[email protected]>
  • Loading branch information
imba-tjd and ghuntley authored Nov 18, 2021
1 parent e2d30d8 commit c6d212f
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# from https://github.com/haskell/haskell-language-server/blob/master/.gitpod.yml
tasks:
- before: |
# Only the /workspace folder is persistent
export XDG_DATA_HOME=/workspace/.local/share
export XDG_CONFIG_HOME=/workspace/.local/config
export XDG_STATE_HOME=/workspace/.local/state
export XDG_CACHE_HOME=/workspace/.cache
export CABAL_DIR=/workspace/.cabal
export STACK_ROOT=/workspace/.stack
# install ghcup, ghc and cabal
export GHCUP_INSTALL_BASE_PREFIX=/workspace
export BOOTSTRAP_HASKELL_NONINTERACTIVE=1
export BOOTSTRAP_HASKELL_MINIMAL=1
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
/workspace/.ghcup/bin/ghcup install ghc --set
/workspace/.ghcup/bin/ghcup install cabal
# Add ghcup binaries to the PATH since VSCode does not see 'source .ghcup/env'
pushd /usr/local/bin
sudo ln -s /workspace/.ghcup/bin/* /usr/local/bin
popd
# Fix the Cabal dir since VSCode does not see CABAL_DIR
cabal update
echo "Symlinking /workspace/.cabal to ~/.cabal"
ln -s /workspace/.cabal ~
init: |
cabal update
vscode:
extensions:
- haskell.haskell
- justusadam.language-haskell
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,18 @@ If you don't have any IDE preferences, we recommend installing
[Haskell plugin](https://marketplace.visualstudio.com/items?itemName=haskell.haskell).
The mentioned plugin would give you everything required to immediately start coding with Haskell.
### Gitpod
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/kowainik/learn4haskell)
[Gitpod](https://www.gitpod.io/) is a VSCode-based Web IDE.
With it, you can get a Haskell environment out-of-the-box.
It's free to use up to 50 hours per month.

Just prepend `gitpod.io#` to your repo URL and you are ready to go.
It will take some time to initialize the workspace for the first time it opens.
It only keeps changes under `/workspace`, and it will be deleted after a period of inactivity unless it's pinned.
### How to develop
The course assumes that you install Haskell tooling (GHC and Cabal), edit code
Expand Down

0 comments on commit c6d212f

Please sign in to comment.