-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy path.gitpod.Dockerfile
28 lines (25 loc) · 1.23 KB
/
.gitpod.Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM gitpod/workspace-base
# Install Nix
ENV USER=gitpod
USER gitpod
RUN sudo sh -c 'mkdir -m 0755 /nix && chown gitpod /nix' \
&& touch .bash_profile \
&& curl https://nixos.org/releases/nix/nix-2.3.14/install | bash -s -- --no-daemon
COPY configuration.nix /tmp
RUN echo 'source $HOME/.nix-profile/etc/profile.d/nix.sh' >> /home/gitpod/.bashrc.d/998-nix \
&& mkdir -p $HOME/.config/nixpkgs && echo '{ allowUnfree = true; }' >> $HOME/.config/nixpkgs/config.nix \
&& . $HOME/.nix-profile/etc/profile.d/nix.sh \
# Install cachix
&& nix-env -iA cachix -f https://cachix.org/api/v1/install \
&& cachix use cachix \
# Install git, drenv
&& nix-env -iA nixpkgs.git nixpkgs.git-lfs nixpkgs.direnv \
# nixos-generate
&& nix-env -f https://github.com/nix-community/nixos-generators/archive/master.tar.gz -i \
&& (cd /tmp && nixos-generate -c ./configuration.nix -f vm-nogui -o ./dist) \
# Direnv config
&& mkdir -p $HOME/.config/direnv \
&& printf '%s\n' '[whitelist]' 'prefix = [ "/workspace"] ' >> $HOME/.config/direnv/config.toml \
&& printf '%s\n' 'source <(direnv hook bash)' >> $HOME/.bashrc.d/999-direnv
# Install qemu
RUN sudo install-packages qemu qemu-system-x86 linux-image-$(uname -r) libguestfs-tools sshpass netcat