From deb0e19892674652b430b3cb89259bb5afc089b8 Mon Sep 17 00:00:00 2001 From: Cyril Cohen Date: Sun, 14 Mar 2021 22:28:53 +0100 Subject: more gitpod config (#722) --- .gitpod.dockerfile | 23 +++++++++++++++++++++++ .gitpod.yml | 12 ++++++++---- 2 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 .gitpod.dockerfile diff --git a/.gitpod.dockerfile b/.gitpod.dockerfile new file mode 100644 index 0000000..9c1da02 --- /dev/null +++ b/.gitpod.dockerfile @@ -0,0 +1,23 @@ +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 3818803..473628c 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,10 +1,14 @@ # The Docker image to run your workspace in. Defaults to gitpod/workspace-full -image: coqorg/coq:8.13 +image: .gitpod.dockerfile # Command to start on workspace startup (optional) tasks: -# - init: install -# command: -# Ports to expose on workspace startup (optional) + - init: sh <(curl -L https://nixos.org/nix/install) --no-daemon && direnv allow && de-preload + - command: sudo docker-up + ports: - port: 8000 onOpen: open-preview + +vscode: + extensions: # from https://open-vsx.org/ + - bbenoist.Nix@1.0.1:TbrU16w37jLfkqA6h20vuQ== -- cgit v1.2.3