diff options
| author | Cyril Cohen | 2021-03-14 22:31:40 +0100 |
|---|---|---|
| committer | Cyril Cohen | 2021-03-15 02:08:56 +0100 |
| commit | 25695dba0365a252cb142d5ba9079bd59f3ccad2 (patch) | |
| tree | 8e7807356032b9e88aafb4725e5cc5d408038ebc | |
| parent | deb0e19892674652b430b3cb89259bb5afc089b8 (diff) | |
fixup gitpod config
| -rw-r--r-- | .gitpod.Dockerfile | 27 | ||||
| -rw-r--r-- | .gitpod.dockerfile | 23 | ||||
| -rw-r--r-- | .gitpod.yml | 12 | ||||
| -rw-r--r-- | _CoqProject | 10 | ||||
| -rwxr-xr-x | etc/utils/setup_gitpod.sh | 4 |
5 files changed, 49 insertions, 27 deletions
diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile new file mode 100644 index 0000000..c5b5cc1 --- /dev/null +++ b/.gitpod.Dockerfile @@ -0,0 +1,27 @@ +FROM gitpod/workspace-full + +USER root + +# Install Nix +RUN addgroup --system nixbld \ + && adduser gitpod nixbld \ + && for i in $(seq 1 30); do useradd -ms /bin/bash nixbld$i && adduser nixbld$i nixbld; done \ + && mkdir -m 0755 /nix && chown gitpod /nix \ + && mkdir -p /etc/nix && echo 'sandbox = false' > /etc/nix/nix.conf + +# Install Nix +CMD /bin/bash -l +USER gitpod +ENV USER gitpod +WORKDIR /home/gitpod + +RUN touch .bash_profile \ + && curl https://nixos.org/releases/nix/nix-2.3.10/install | sh + +RUN echo '. /home/gitpod/.nix-profile/etc/profile.d/nix.sh' >> /home/gitpod/.bashrc + +# Install coq & math-comp environement +RUN . /home/gitpod/.nix-profile/etc/profile.d/nix.sh \ + && nix-env -iA cachix -f https://cachix.org/api/v1/install \ + && cachix use coq \ + && cachix use math-comp diff --git a/.gitpod.dockerfile b/.gitpod.dockerfile deleted file mode 100644 index 9c1da02..0000000 --- a/.gitpod.dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -FROM gitpod/workspace-full - -# 0. Switch to root -USER root - -# 1. Install direnv & git-lfs -RUN sudo apt-get install -y \ - direnv \ - git-lfs - -# 2. Configure Nix -CMD /bin/bash -l -USER gitpod -ENV USER gitpod -WORKDIR /home/gitpod - -RUN mkdir -p /home/gitpod/.config/nixpkgs && echo '{ allowUnfree = true; }' >> /home/gitpod/.config/nixpkgs/config.nix - -RUN echo '. /home/gitpod/.nix-profile/etc/profile.d/nix.sh' >> /home/gitpod/.bashrc -RUN echo 'eval "$(direnv hook bash)"' >> /home/gitpod/.bashrc - -# n. Give back control -USER root
\ No newline at end of file diff --git a/.gitpod.yml b/.gitpod.yml index 473628c..c4141f8 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,14 +1,18 @@ # The Docker image to run your workspace in. Defaults to gitpod/workspace-full -image: .gitpod.dockerfile +image: + file: .gitpod.Dockerfile + # Command to start on workspace startup (optional) tasks: - - init: sh <(curl -L https://nixos.org/nix/install) --no-daemon && direnv allow && de-preload - - command: sudo docker-up + - before: nix-shell ports: - port: 8000 onOpen: open-preview vscode: - extensions: # from https://open-vsx.org/ + extensions: - bbenoist.Nix@1.0.1:TbrU16w37jLfkqA6h20vuQ== + - maximedenes.vscoq@0.3.2:nH2SKs3TvzC87hvAzEEpyg== + - gares.coq-elpi-lang@0.0.4:fd+apIChnUwoQhvWFW33KA== + - gares.elpi-lang@0.1.1:Hq2+Ku1u3oO5KPtLqtFsIA== diff --git a/_CoqProject b/_CoqProject new file mode 100644 index 0000000..5493330 --- /dev/null +++ b/_CoqProject @@ -0,0 +1,10 @@ +-I mathcomp +-R mathcomp mathcomp + +-arg -w -arg -projection-no-head-constant +-arg -w -arg -redundant-canonical-projection +-arg -w -arg -notation-overridden +-arg -w -arg +duplicate-clear +-arg -w -arg +non-primitive-record +-arg -w -arg +undeclared-scope +-arg -w -arg -deprecated-hint-without-locality diff --git a/etc/utils/setup_gitpod.sh b/etc/utils/setup_gitpod.sh new file mode 100755 index 0000000..f7538c0 --- /dev/null +++ b/etc/utils/setup_gitpod.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +mkdir -p .theia +echo "{ \"coqtop.binPath\": \"$COQBIN\" }" > .theia/settings.json |
