Use SCRIPT_DIR, add sshpass and auto-mount workspaces, update flakes
This commit is contained in:
parent
8534f7efb9
commit
9aa72fade7
8 changed files with 292 additions and 413 deletions
|
|
@ -76,7 +76,7 @@ mount_workspaces() {
|
|||
local i=0
|
||||
while (( i < workspace_count )); do
|
||||
local path mount_tag
|
||||
path=$(jq -r ".[$i].path" "$QVM_WORKSPACES_FILE")
|
||||
path=$(jq -r ".[$i].host_path" "$QVM_WORKSPACES_FILE")
|
||||
mount_tag=$(jq -r ".[$i].mount_tag" "$QVM_WORKSPACES_FILE")
|
||||
|
||||
if [[ -z "$path" || -z "$mount_tag" || "$path" == "null" || "$mount_tag" == "null" ]]; then
|
||||
|
|
@ -93,9 +93,9 @@ mount_workspaces() {
|
|||
fi
|
||||
|
||||
log_info " - $path -> $mount_tag"
|
||||
cmd_array+=(-virtfs "local,path=$path,mount_tag=$mount_tag,security_model=mapped-xattr,trans=virtio,version=9p2000.L,msize=104857600")
|
||||
cmd_array+=(-virtfs "local,path=$path,mount_tag=$mount_tag,security_model=mapped-xattr")
|
||||
|
||||
(( i++ ))
|
||||
(( i++ )) || true # Prevent set -e from exiting when i was 0
|
||||
done
|
||||
}
|
||||
|
||||
|
|
@ -173,10 +173,11 @@ main() {
|
|||
-device "virtio-net-pci,netdev=net0"
|
||||
|
||||
# 9p mounts for shared caches (security_model=mapped-xattr for proper permissions)
|
||||
-virtfs "local,path=$QVM_CARGO_HOME,mount_tag=cargo_home,security_model=mapped-xattr,trans=virtio,version=9p2000.L,msize=104857600"
|
||||
-virtfs "local,path=$QVM_CARGO_TARGET,mount_tag=cargo_target,security_model=mapped-xattr,trans=virtio,version=9p2000.L,msize=104857600"
|
||||
-virtfs "local,path=$QVM_PNPM_STORE,mount_tag=pnpm_store,security_model=mapped-xattr,trans=virtio,version=9p2000.L,msize=104857600"
|
||||
-virtfs "local,path=$QVM_SCCACHE,mount_tag=sccache,security_model=mapped-xattr,trans=virtio,version=9p2000.L,msize=104857600"
|
||||
# Note: trans, version, msize are kernel-side mount options (in NixOS flake), not QEMU options
|
||||
-virtfs "local,path=$QVM_CARGO_HOME,mount_tag=cargo_home,security_model=mapped-xattr"
|
||||
-virtfs "local,path=$QVM_CARGO_TARGET,mount_tag=cargo_target,security_model=mapped-xattr"
|
||||
-virtfs "local,path=$QVM_PNPM_STORE,mount_tag=pnpm_store,security_model=mapped-xattr"
|
||||
-virtfs "local,path=$QVM_SCCACHE,mount_tag=sccache,security_model=mapped-xattr"
|
||||
)
|
||||
|
||||
# Add workspace mounts from registry
|
||||
|
|
@ -187,8 +188,8 @@ main() {
|
|||
# Serial console to log file
|
||||
-serial "file:$QVM_SERIAL_LOG"
|
||||
|
||||
# No graphics
|
||||
-nographic
|
||||
# No graphics (use -display none for daemonized mode)
|
||||
-display none
|
||||
|
||||
# Daemonize with PID file
|
||||
-daemonize
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue