blob: f1ae7c99c187a15b66859613c7c29cb9bd49b8de (
plain)
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
|
#!/usr/bin/env sh
if [ -z "$1" ]; then
echo "Must provide a project directory to mount"
exit 1
fi;
bwrap \
--ro-bind /usr /usr \
--ro-bind /lib /lib \
--ro-bind /lib64 /lib64 \
--ro-bind /bin /bin \
--ro-bind /etc/ssl /etc/ssl \
--ro-bind /etc/ca-certificates /etc/ca-certificates \
--ro-bind /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf \
--dev /dev \
--proc /proc \
--tmpfs /home/$(whoami) \
--tmpfs /tmp \
--bind ~/.local/share/uv/ /home/$(whoami)/.local/share/uv \
--bind ~/.local/share/npm/ /home/$(whoami)/.local/share/npm \
--bind ~/.cache/uv /home/$(whoami)/.cache/uv \
--bind ~/.cache/huggingface /home/$(whoami)/.cache/huggingface \
--bind ~/.cargo /home/$(whoami)/.cargo \
--bind ~/.rustup /home/$(whoami)/.rustup \
--bind ~/.pi /home/$(whoami)/.pi \
--bind ~/.npmrc /home/$(whoami)/.npmrc \
--clearenv \
--setenv HOME /home/$(whoami) \
--setenv USER $(whoami) \
--setenv SHELL /bin/bash \
--setenv PATH /home/$(whoami)/.local/bin:/home/$(whoami)/.local/share/npm/bin::/usr/local/sbin:/usr/local/bin:/usr/bin \
--bind "$1" /home/$(whoami)/project/ \
--chdir /home/$(whoami)/project/ \
bash
|