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
| | #!/bin/execlineb -WP
# SPDX-License-Identifier: EUPL-1.2+
# SPDX-FileCopyrightText: 2025 Yureka Lilian <yureka@cyberchaos.dev>
# SPDX-FileCopyrightText: 2025 Alyssa Ross <hi@alyssa.is>
importas -i VM VM
s6-ipcserver-socketbinder -a 0770 /run/vm/by-id/${VM}/router-driver.sock
fdmove -c 3 0
s6-ipcserver-socketbinder -a 0770 /run/router/${VM}
fdmove -c 4 0
redirfd -r 0 /dev/null
if { chown -- vmm-${VM} /run/vm/by-id/${VM}/router-driver.sock }
if { chgrp -- vmm /run/router/${VM} }
# Notify readiness.
if {
fdmove -c 5 1
echo
}
s6-setuidgid router
bwrap
--unshare-all
--unshare-user
--dev-bind / /
--setenv RUST_LOG spectrum-router=debug,info
--setenv LISTEN_FDS 2
--tmpfs /tmp
--dev /dev
--tmpfs /dev/shm
--ro-bind /nix /nix
--ro-bind /etc /etc
--tmpfs /run
--ro-bind /usr /usr
--ro-bind /lib /lib
--bind /run/vm/by-id/${VM} /run/vm/by-id/${VM}
--
getpid LISTEN_PID
spectrum-router
|