Skip to content

Commit 1f1e2c0

Browse files
committed
Devcontainer setup for HLS
1 parent f69a28e commit 1f1e2c0

File tree

4 files changed

+22
-15
lines changed

4 files changed

+22
-15
lines changed

.devcontainer/Dockerfile

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@ ARG VARIANT="focal"
55
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}
66

77
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
8-
&& apt-get -y install --no-install-recommends gcc libc6-dev libffi-dev libgmp-dev make xz-utils zlib1g-dev libtinfo-dev
8+
&& apt-get -y install --no-install-recommends \
9+
build-essential curl libffi-dev libffi7 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5 \
10+
gcc libc6-dev make xz-utils zlib1g-dev libtinfo-dev
911

10-
RUN curl -sSL https://get.haskellstack.org/ | sh
12+
USER vscode
13+
14+
RUN curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | \
15+
BOOTSTRAP_HASKELL_MINIMAL=1 \
16+
BOOTSTRAP_HASKELL_NONINTERACTIVE=1 \
17+
BOOTSTRAP_HASKELL_VERBOSE=1 \
18+
BOOTSTRAP_HASKELL_ADJUST_BASHRC=1 \
19+
GHCUP_PROFILE_FILE=/home/vscode/.bashrc \
20+
MY_SHELL=bash \
21+
sh
22+
23+
USER root

.devcontainer/devcontainer.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,14 @@
88
"args": { "VARIANT": "focal" }
99
},
1010

11-
// Set *default* container specific settings.json values on container create.
1211
"settings": {},
1312

14-
// Add the IDs of extensions you want installed when the container is created.
1513
"extensions": [
1614
"haskell.haskell"
1715
],
1816

19-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
20-
// "forwardPorts": [],
17+
"onCreateCommand": "ghcup install hls && ghcup install stack",
18+
"updateContentCommand": "stack build --test --only-dependencies",
2119

22-
// Use 'postCreateCommand' to run commands after the container is created.
23-
"postCreateCommand": "stack setup",
24-
25-
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
2620
"remoteUser": "vscode"
2721
}

stack.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ extra-package-dbs: []
33
packages:
44
- '.'
55
extra-deps: []
6-
resolver: lts-20.1
6+
resolver: lts-19.33

stack.yaml.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
packages: []
77
snapshots:
88
- completed:
9-
sha256: b73b2b116143aea728c70e65c3239188998bac5bc3be56465813dacd74215dc5
10-
size: 648424
11-
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/20/1.yaml
12-
original: lts-20.1
9+
sha256: 6d1532d40621957a25bad5195bfca7938e8a06d923c91bc52aa0f3c41181f2d4
10+
size: 619204
11+
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/19/33.yaml
12+
original: lts-19.33

0 commit comments

Comments
 (0)