refactor: Use systemd-nspawn directly instead of machinectl

- Replace machinectl shell with systemd-nspawn -q -D
- Add systemd-nspawn to sudoers permissions
- Simpler and more direct container entry
- No dependency on systemd-machined service
This commit is contained in:
Claude
2025-11-07 18:57:53 +00:00
parent 111fa7b828
commit 66a5c6d16f
2 changed files with 2 additions and 2 deletions

View File

@@ -65,7 +65,7 @@ cp -rf ./cfg/os-release root.x86_64/etc/os-release
# Configure sudoers for wheel group
echo "Configuring sudoers..."
arch-chroot root.x86_64 /bin/sh -c 'echo "%wheel ALL=(ALL:ALL) NOPASSWD: /usr/bin/pacman, /usr/bin/pacstrap, /usr/bin/arch-chroot, /usr/bin/rm, /usr/bin/mkdir, /usr/bin/mv, /usr/bin/cp, /usr/bin/poweroff, /usr/bin/reboot, /usr/bin/machinectl, /bin/bash" >> /etc/sudoers'
arch-chroot root.x86_64 /bin/sh -c 'echo "%wheel ALL=(ALL:ALL) NOPASSWD: /usr/bin/pacman, /usr/bin/pacstrap, /usr/bin/arch-chroot, /usr/bin/rm, /usr/bin/mkdir, /usr/bin/mv, /usr/bin/cp, /usr/bin/poweroff, /usr/bin/reboot, /usr/bin/machinectl, /usr/bin/systemd-nspawn, /bin/bash" >> /etc/sudoers'
# Install aigpt (aios core package)
echo "Installing aigpt..."

View File

@@ -75,7 +75,7 @@ if [[ -o login ]] && [[ -o interactive ]]; then
if [[ -z "$INSIDE_WORKSPACE" ]]; then
# Running as ai user on aios OS - enter workspace container
export INSIDE_WORKSPACE=1
exec sudo machinectl shell workspace
exec sudo systemd-nspawn -q -D /var/lib/machines/workspace /bin/zsh
else
# Running as root inside workspace container - start claude
if command -v claude &>/dev/null; then