forked from TerrorJack/gitpod-ghc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitpod.yml
115 lines (99 loc) · 3.28 KB
/
.gitpod.yml
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
github:
prebuilds:
branches: true
master: true
image:
file: Dockerfile
tasks:
- before: |
set -euxo pipefail
sudo chown $UID /etc/resolv.conf
for f in .cabal .cache .cargo .config .deno .docker .ghc .ghcup .gnupg .local .parallel .rustup .ssh
do
mkdir -p ~/$f
if [[ -d /workspace/$f ]]
then
rm -rf ~/$f
else
mv ~/$f /workspace
fi
mkdir ~/$f
sudo mount --bind /workspace/$f ~/$f
done
for f in .bash_history .bashrc .git-credentials .gitconfig .nix-channels .node_repl_history .python_history
do
touch ~/$f
if [[ -f /workspace/$f ]]
then
rm ~/$f
else
mv ~/$f /workspace
fi
touch ~/$f
sudo mount --bind /workspace/$f ~/$f
done
sudo mkdir -m 0755 /nix
sudo chown $UID /nix
mkdir -m 0755 -p /workspace/.nix
sudo mount --bind /workspace/.nix /nix
init: |
echo 'touch /tmp/.bashrc' >> ~/.bashrc
echo 'source /tmp/.bashrc' >> ~/.bashrc
echo 'eval "$(direnv hook bash)"' >> ~/.bashrc
echo 'Host *.gitpod.io' > ~/.ssh/config
echo ' StrictHostKeyChecking no' >> ~/.ssh/config
ssh-keyscan -H github.com > ~/.ssh/known_hosts
ssh-keyscan -H gitlab.haskell.org >> ~/.ssh/known_hosts
/workspace/gitpod-ghc/utils/init-nix.sh
/workspace/gitpod-ghc/utils/init-proot.sh
/workspace/gitpod-ghc/utils/init-sccache.sh
/workspace/gitpod-ghc/utils/init-mold.sh
/workspace/gitpod-ghc/utils/init-deno.sh
/workspace/gitpod-ghc/utils/init-z3.sh
/workspace/gitpod-ghc/utils/init-haskell.sh
/workspace/gitpod-ghc/utils/init-hls.sh
/workspace/gitpod-ghc/utils/init-ghc.sh
command: |
mkdir ~/.nix-defexpr
ln -s /nix/var/nix/profiles/per-user/$USER/channels ~/.nix-defexpr/channels
ln -s /nix/var/nix/profiles/per-user/root/channels ~/.nix-defexpr/channels_root
ln -s /nix/var/nix/profiles/per-user/$USER/profile ~/.nix-profile
dbus-launch --sh-syntax > /tmp/.bashrc
echo "export DBUS_SESSION_BUS_PID" >> /tmp/.bashrc
source /tmp/.bashrc
echo "" | gnome-keyring-daemon --unlock >> /tmp/.bashrc
echo "export GNOME_KEYRING_CONTROL" >> /tmp/.bashrc
echo "export SSH_AUTH_SOCK" >> /tmp/.bashrc
source /tmp/.bashrc
if [[ -v SSH_PRIVATE_KEY ]]
then
echo "-----BEGIN OPENSSH PRIVATE KEY-----" > /tmp/id-gitpod
printenv SSH_PRIVATE_KEY >> /tmp/id-gitpod
echo "-----END OPENSSH PRIVATE KEY-----" >> /tmp/id-gitpod
chmod 600 /tmp/id-gitpod
ssh-add /tmp/id-gitpod
rm /tmp/id-gitpod
fi
if [[ -v TAILSCALE_AUTHKEY ]]
then
sudo tailscaled &
sudo tailscale up --auth-key=$TAILSCALE_AUTHKEY
fi
if [[ -d /workspace/ghc ]]
then
code -r /workspace/ghc
fi
exit
vscode:
extensions:
- ccls-project.ccls
- eamodio.gitlens
- haskell.haskell
- justusadam.language-haskell
- arrterian.nix-env-selector
- esbenp.prettier-vscode
- ms-python.python
- stkb.rewrap
- https://github.com/rust-lang/rust-analyzer/releases/download/2022-07-18/rust-analyzer-linux-x64.vsix
- timonwong.shellcheck
- ms-azuretools.vscode-docker