Repository navigation
Expand file tree
/
Copy pathbwrap
More file actions
executable file
·113 lines (95 loc) · 1.76 KB
/
Copy pathbwrap
File metadata and controls
executable file
·113 lines (95 loc) · 1.76 KB
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
#!/bin/bash
set -eu
source "$(dirname "$(realpath "$0")")/common.sh"
OPTS=(
--die-with-parent
--unshare-all
--share-net
--dev /dev
--proc /proc
--tmpfs /tmp
--bind "$ENV/home" "$HOME"
--tmpfs "$ENV"
--tmpfs "$DIR"
)
SYSPATHS=(
/usr
/bin
/lib
/lib64
/etc/hosts
/etc/localtime
/etc/ssl/certs
/etc/resolv.conf
/etc/nsswitch.conf
/run/systemd/resolve
/etc/manpath.config
/etc/alternatives
/etc/bash_completion.d
/etc/bash_completion
/etc/bash.bashrc
/etc/locale.conf
/etc/vim/vimrc
/etc/inputrc
/etc/profile
/etc/passwd
/etc/group
)
for syspath in "${SYSPATHS[@]}"; do
OPTS+=(--ro-bind "$syspath" "$syspath")
done
shopt -s dotglob nullglob
for skelpath in /etc/skel/*; do
OPTS+=(--ro-bind "$skelpath" "$HOME/$(basename "$skelpath")")
done
shopt -u dotglob nullglob
OPTS+=(--ro-bind-try "$HOME/.Xauthority" "$HOME/.Xauthority")
OPTS+=(--ro-bind-try "$HOME/.gitconfig" "$HOME/.gitconfig")
OPTS+=(--ro-bind-try "/tmp/tmux-$UID/" "/tmp/tmux-$UID/")
ENVPATHS=(
node
venv
go
dist
)
for envpath in "${ENVPATHS[@]}"; do
OPTS+=(--ro-bind-try "$ENV/$envpath" "$ENV/$envpath")
PATH="$ENV/$envpath/bin:$PATH"
done
OPTS+=(--bind "$ENV/tmp" "$ENV/tmp")
OPTS+=(--bind "$ENV/www" "$ENV/www")
DIRPATHS=(
env
src
tmp
lib
wip
llm
)
LLMPATHS=(
.agents
AGENTS.md
)
if test "${DIRENV_ROOT:-}"; then
for dirpath in "${DIRPATHS[@]}"; do
OPTS+=(--bind-try "$DIR/$dirpath" "$DIR/$dirpath")
done
for llmpath in "${LLMPATHS[@]}"; do
OPTS+=(--bind-try "$DIR/$llmpath" "$DIR/$llmpath")
done
else
OPTS+=(--bind "$PWD" "$PWD")
fi
OPTS+=(
--chdir "$PWD"
--setenv "WSDIR" "$DIR"
--setenv "WSTAG" "$TAG"
--setenv "PATH" "$PATH"
--setenv "VISUAL" "vim"
)
if ! test "$*"; then
set -- "$SHELL"
fi
echo "enter"
export debian_chroot=llmdev
exec bwrap "${OPTS[@]}" -- "$@"
<
2D57
/div>