Skip to content

Commit 6a65ac2

Browse files
committed
feat(vagrant): add Vagrant support for GNOME Shell development environment
1 parent f904f87 commit 6a65ac2

6 files changed

Lines changed: 187 additions & 9 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,6 @@ Thumbs.db
3131
# Temporary files
3232
*.tmp
3333
*.temp
34+
35+
# Vagrant
36+
.vagrant/

Vagrantfile

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
# Aurora Shell – Vagrant-based GNOME Shell devkit environment.
5+
# Mirrors the Podman toolbox workflow (`just toolbox *`).
6+
#
7+
# Requirements (host):
8+
# - Vagrant ≥ 2.3
9+
# - vagrant-libvirt plugin
10+
#
11+
# Quick start:
12+
# just vagrant create # boot + provision
13+
# just vagrant run # build, install & launch gnome-shell --devkit
14+
# just vagrant ssh # interactive shell inside VM
15+
# just vagrant remove # destroy VM
16+
17+
VAGRANTFILE_API_VERSION = "2"
18+
19+
VM_NAME = "aurora-shell-devel"
20+
BOX = "generic/arch"
21+
BOX_VERSION = "4.3.12"
22+
CPUS = 2
23+
MEMORY_MB = 2048
24+
25+
PACKAGES = %w[
26+
gnome-shell
27+
dbus
28+
mesa
29+
gnome-keyring
30+
xdg-desktop-portal-gnome
31+
nodejs
32+
npm
33+
rsync
34+
git
35+
just
36+
zip
37+
].freeze
38+
39+
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
40+
config.vm.box = BOX
41+
config.vm.box_version = BOX_VERSION
42+
config.vm.hostname = VM_NAME
43+
config.vm.boot_timeout = 600
44+
45+
# ----------------------------------------------------------
46+
# Provider: libvirt (QEMU/KVM)
47+
# Requires: vagrant plugin install vagrant-libvirt
48+
# ----------------------------------------------------------
49+
config.vm.provider :libvirt do |lv|
50+
lv.driver = "kvm"
51+
lv.memory = MEMORY_MB
52+
lv.cpus = CPUS
53+
lv.video_vram = 64
54+
lv.machine_type = "virt" if `uname -m`.strip == "aarch64"
55+
lv.graphics_type = "spice"
56+
lv.channel :type => "spicevmc", :target_name => "com.redhat.spice.0", :target_type => "virtio"
57+
end
58+
59+
# ----------------------------------------------------------
60+
# Synced folder: project root → /home/vagrant/aurora-shell
61+
# ----------------------------------------------------------
62+
config.vm.synced_folder ".", "/home/vagrant/aurora-shell",
63+
type: "rsync",
64+
rsync__exclude: [
65+
".git/",
66+
".vagrant/",
67+
"node_modules/",
68+
"dist/",
69+
],
70+
rsync__args: ["--verbose", "--archive", "--delete", "--compress"]
71+
72+
# ----------------------------------------------------------
73+
# Provision: install system packages + Yarn 4
74+
# ----------------------------------------------------------
75+
config.vm.provision "shell", privileged: true, inline: <<~SHELL
76+
set -e
77+
78+
echo "==> Refreshing package databases and keyring..."
79+
echo 'Server = https://geo.mirror.pkgbuild.com/$repo/os/$arch' > /etc/pacman.d/mirrorlist
80+
pacman -Sy --noconfirm archlinux-keyring
81+
pacman-key --populate archlinux
82+
83+
echo "==> Updating system packages..."
84+
pacman -Su --noconfirm
85+
86+
echo "==> Installing required packages..."
87+
pacman -S --noconfirm #{PACKAGES.join(" ")}
88+
89+
echo "==> Installing and enabling Yarn via corepack..."
90+
npm install -g corepack
91+
corepack enable
92+
93+
echo "==> Provisioning complete."
94+
SHELL
95+
96+
# ----------------------------------------------------------
97+
# Provision (user-level): prepare Yarn + build extension
98+
# ----------------------------------------------------------
99+
config.vm.provision "shell", privileged: false, inline: <<~SHELL
100+
set -e
101+
cd /home/vagrant/aurora-shell
102+
103+
echo "==> Preparing Yarn via corepack..."
104+
corepack prepare --activate 2>/dev/null || true
105+
106+
echo "==> Installing Node dependencies..."
107+
yarn install --immutable 2>/dev/null || yarn install
108+
109+
echo "==> Building extension..."
110+
just build
111+
112+
echo "==> Installing extension..."
113+
just install
114+
115+
echo ""
116+
echo "Aurora Shell is ready inside the VM."
117+
echo "Run 'just vagrant run' to launch gnome-shell --devkit."
118+
SHELL
119+
end

justfile

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
uuid := "aurora-shell@luminusos.github.io"
22
ext_dir := env("HOME") / ".local/share/gnome-shell/extensions" / uuid
3-
toolbox_name := "gnome-shell-devel"
3+
toolbox_name := "aurora-shell-devel"
44
toolbox_image := "registry.fedoraproject.org/fedora-toolbox:44"
5+
vagrant_name := "aurora-shell-devel"
56

67
default:
78
@just --list
@@ -13,6 +14,7 @@ build: deps
1314
yarn build
1415
cp metadata.json dist/
1516
cp -r schemas dist/ 2>/dev/null || true
17+
cp -r icons dist/ 2>/dev/null || true
1618
just compile-mo
1719

1820
package: build
@@ -104,7 +106,8 @@ all: clean build install
104106
run:
105107
#!/usr/bin/env bash
106108
set -e
107-
env XDG_CURRENT_DESKTOP=GNOME dbus-run-session gnome-shell --wayland --devkit
109+
env GSETTINGS_SCHEMA_DIR=/usr/share/glib-2.0/schemas \
110+
XDG_CURRENT_DESKTOP=GNOME dbus-run-session gnome-shell --wayland --devkit
108111
109112
toolbox action *args:
110113
#!/usr/bin/env bash
@@ -127,3 +130,31 @@ toolbox action *args:
127130
exit 1
128131
;;
129132
esac
133+
134+
# Vagrant-based devkit VM (mirrors 'toolbox' but uses a full Fedora VM via Vagrant).
135+
# Actions: create | run | ssh | remove
136+
vagrant action *args:
137+
#!/usr/bin/env bash
138+
set -e
139+
case "{{ action }}" in
140+
"create")
141+
echo "Booting and provisioning Vagrant VM '{{ vagrant_name }}'..."
142+
vagrant up
143+
;;
144+
"run")
145+
bash scripts/run-vagrant-gnome-shell.sh
146+
;;
147+
"ssh")
148+
vagrant ssh
149+
;;
150+
"remove")
151+
echo "Destroying Vagrant VM '{{ vagrant_name }}'..."
152+
vagrant destroy -f
153+
echo "VM '{{ vagrant_name }}' destroyed."
154+
;;
155+
*)
156+
echo "Unknown vagrant action: {{ action }}"
157+
echo "Available: create, run, ssh, remove"
158+
exit 1
159+
;;
160+
esac

scripts/create-toolbox.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,15 @@
33
set -e
44

55
TOOLBOX="${1:-gnome-shell-devel}"
6-
IMAGE="${2:-registry.fedoraproject.org/fedora-toolbox:42}"
6+
IMAGE="${2:-registry.fedoraproject.org/fedora-toolbox:44}"
77

88
PACKAGES=(
99
gnome-shell
1010
glib2-devel
11-
mutter-devel
11+
mutter-devkit
12+
mutter-tests
1213
dbus-daemon
13-
mesa-dri-drivers
14-
mesa-vulkan-drivers
15-
gnome-keyring
16-
xdg-desktop-portal-gnome
14+
gsettings-desktop-schemas
1715
)
1816

1917
echo "Creating toolbox $TOOLBOX from $IMAGE..."

scripts/run-gnome-shell.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ TOOLBOX="${1:-gnome-shell-devel}"
77
SHELL_ENV=(
88
XDG_CURRENT_DESKTOP=GNOME
99
XDG_SESSION_TYPE=wayland
10-
WAYLAND_DISPLAY=$WAYLAND_DISPLAY
10+
GSETTINGS_SCHEMA_DIR=/usr/share/glib-2.0/schemas
1111
)
1212
SHELL_ARGS=( --wayland --devkit )
1313

scripts/run-vagrant-gnome-shell.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
# Run GNOME Shell --devkit inside the Vagrant VM.
3+
# Called by: just vagrant run
4+
5+
set -e
6+
7+
PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
8+
9+
echo "==> Syncing project files into VM..."
10+
cd "$PROJECT_DIR"
11+
vagrant rsync
12+
13+
echo "==> Launching gnome-shell --devkit inside Vagrant VM..."
14+
vagrant ssh -- -t '
15+
set -e
16+
cd /home/vagrant/aurora-shell
17+
18+
echo "==> Rebuilding & installing extension..."
19+
just build
20+
just install
21+
22+
echo "==> Starting GNOME Shell devkit session..."
23+
exec env \
24+
XDG_CURRENT_DESKTOP=GNOME \
25+
XDG_SESSION_TYPE=wayland \
26+
dbus-run-session gnome-shell --wayland --devkit
27+
'

0 commit comments

Comments
 (0)