Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
FROM alpine:latest

ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=1000

# Install required packages (Alpine equivalents)
RUN apk add --no-cache \
curl \
ca-certificates \
git \
build-base \
gmp-dev \
zlib-dev \
sudo \
bash \
libc6-compat \
ncurses-dev \
xz

# Create user with sudo access
RUN addgroup -g $USER_GID $USERNAME && \
adduser -D -s /bin/bash -u $USER_UID -G $USERNAME $USERNAME && \
mkdir -p /etc/sudoers.d && \
echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/$USERNAME && \
chmod 0440 /etc/sudoers.d/$USERNAME

USER $USERNAME
WORKDIR /home/$USERNAME

RUN mkdir -p /home/$USERNAME/.ghcup/bin

# Install GHCup
RUN curl -sSL https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup -o /home/$USERNAME/.ghcup/bin/ghcup && \
chmod +x /home/$USERNAME/.ghcup/bin/ghcup

ENV PATH="/home/$USERNAME/.ghcup/bin:/home/$USERNAME/.cabal/bin:${PATH}"

# Install Haskell toolchain
RUN ghcup install ghc 9.12.2 && \
ghcup set ghc 9.12.2 && \
ghcup install hls 2.10.0.0 && \
ghcup set hls 2.10.0.0 && \
ghcup install cabal 3.14.2.0 && \
ghcup set cabal 3.14.2.0 && \
ln -sf /home/$USERNAME/.ghcup/bin/haskell-language-server-wrapper /home/$USERNAME/.ghcup/bin/hls

# Set up the PATH in bashrc
RUN echo 'export PATH="/home/'$USERNAME'/.ghcup/bin:/home/'$USERNAME'/.cabal/bin:$PATH"' >> /home/$USERNAME/.bashrc

# Verify installations
RUN ghc --version && cabal --version && hls --version

# Update cabal package list
RUN cabal update

ENTRYPOINT ["/bin/bash"]
13 changes: 13 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "Haskell DevContainer (GHCup)",
"build": {
"dockerfile": "Dockerfile"
},
"settings": {
"haskell.manageHLS": "GHCup"
},
"extensions": [
"haskell.haskell"
],
"remoteUser": "vscode"
}
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ It is structured as follows:

- bend.cabal: the cabal file. Bend doesn't use stack.
- Build this project with `cabal build`.
- Run with `bend file.bend`.
- Run with `cabal run bend file.bend`.

- src/Core/Type.hs: most important file, always read. Includes every type used in
this repo, including the Term type for Bend's core language.
Expand Down