feat: switch to gnome console and firefox-only browser

This commit is contained in:
2025-09-15 15:29:43 +02:00
parent 7988306ab0
commit ac155a61b6
3 changed files with 68 additions and 57 deletions

View File

@@ -1,4 +1,4 @@
# 🚀 CODE CRISPIES Workshop Infrastructure # 🚀 DIGITAL INDEPENDENCE DAY Workshop Infrastructure
Single-participant learning environments with local practice and cloud deployment capabilities. Single-participant learning environments with local practice and cloud deployment capabilities.
@@ -125,7 +125,7 @@ Based on Co-op Cloud with quality scoring:
- `setup` - **REQUIRED FIRST**: Setup local DNS proxy - `setup` - **REQUIRED FIRST**: Setup local DNS proxy
- `recipes` - Show complete Co-op Cloud catalog - `recipes` - Show complete Co-op Cloud catalog
- `deploy <app>` - Deploy locally with tab completion - `deploy <app>` - Deploy locally with tab completion
- `browser [firefox|chromium] [app]` - Launch browser [to specific app] - `browser [app]` - Launch Firefox [to specific app]
- `connect <server>` - SSH to cloud server with tab completion - `connect <server>` - SSH to cloud server with tab completion
- `desktop` - Start GUI session - `desktop` - Start GUI session
- `help` - Show all commands and debug info - `help` - Show all commands and debug info
@@ -134,10 +134,10 @@ Based on Co-op Cloud with quality scoring:
```bash ```bash
# Deploy and open WordPress # Deploy and open WordPress
deploy wordpress deploy wordpress
browser firefox wordpress # Opens http://wordpress.workshop.local in Firefox browser wordpress # Opens http://wordpress.workshop.local in Firefox
# Just open browser # Just open browser
browser firefox # Opens Firefox with blank page browser # Opens Firefox with blank page
# Use tab completion # Use tab completion
deploy <TAB> # Shows all available recipes deploy <TAB> # Shows all available recipes

View File

@@ -334,6 +334,7 @@ isoConfig
networkmanager networkmanager
docker docker
docker-compose docker-compose
gnome-terminal
bash bash
wget wget
jq jq
@@ -347,6 +348,7 @@ isoConfig
# Additional font packages for QEMU # Additional font packages for QEMU
dejavu_fonts dejavu_fonts
liberation_ttf liberation_ttf
fontconfig
]; ];
# System Setup Service (Root Tasks) # System Setup Service (Root Tasks)
@@ -1098,40 +1100,22 @@ isoConfig
} }
browser() { browser() {
local target_url="about:blank" local target_url="about:blank"
local browser_cmd="firefox"
# Check if first argument is a browser choice if [[ -n "$1" ]]; then
if [[ "$1" == "firefox" || "$1" == "chromium" ]]; then target_url="http://$1.workshop.local"
browser_cmd="$1" echo "🌐 Opening $1 at $target_url in Firefox"
shift else
fi echo "🌐 Opening Firefox browser"
fi
if [[ -n "$1" ]]; then if [[ -n "$DISPLAY" ]]; then
target_url="http://$1.workshop.local" firefox "$target_url" &
echo "🌐 Opening $1 at $target_url (using $browser_cmd)" else
else echo " No GUI session. Run 'desktop' first"
echo "🌐 Opening $browser_cmd browser" echo "🌐 Target was: $target_url"
fi fi
}
if [[ -n "$DISPLAY" ]]; then
case "$browser_cmd" in
firefox)
firefox "$target_url" &
;;
chromium)
chromium --no-sandbox "$target_url" &
;;
*)
echo " Unknown browser: $browser_cmd"
return 1
;;
esac
else
echo " No GUI session. Run 'desktop' first"
echo "🌐 Target was: $target_url"
fi
}
recipes() { recipes() {
echo "📚 Complete Co-op Cloud Recipe Catalog:" echo "📚 Complete Co-op Cloud Recipe Catalog:"
@@ -1208,19 +1192,51 @@ isoConfig
# Font packages for GUI rendering (QEMU GTK display) # Font packages for GUI rendering (QEMU GTK display)
fonts.packages = with pkgs; [ fonts.packages = with pkgs; [
dejavu_fonts dejavu_fonts # DejaVu fonts including Sans Mono
liberation_ttf liberation_ttf
noto-fonts noto-fonts
cantarell-fonts # GNOME default font cantarell-fonts # GNOME default font
ubuntu-classic # Additional font for compatibility ubuntu-classic # Additional font for compatibility
freefont_ttf # Additional fonts
fontconfig # Enhanced font configuration for QEMU
]; ];
# GUI Configuration # GUI Configuration
services.xserver = { services.xserver = {
enable = true; enable = true;
desktopManager.gnome.enable = true; desktopManager.gnome.enable = true;
displayManager.gdm.enable = true; displayManager.gdm.enable = true;
}; };
# Exclude unnecessary GNOME packages
environment.gnome.excludePackages = with pkgs; [
gnome-photos
gnome-tour
gnome-music
gnome-maps
cheese
epiphany
geary
evince
totem
simple-scan
yelp
gnome-contacts
gnome-weather
gnome-clocks
gnome-terminal
];
# Auto-start console and set GNOME settings
environment.etc."xdg/autostart/gnome-console.desktop".text = ''
[Desktop Entry]
Type=Application
Name=Workshop Console
Exec=sh -c "gsettings set org.gnome.shell favorite-apps \"['org.gnome.TextEditor.desktop', 'org.gnome.Console.desktop', 'firefox.desktop']\" && gsettings set org.gnome.shell welcome-dialog-last-shown-version \"999999\" && gnome-console --maximize --hide-menubar --title=\"Workshop Console\""
NoDisplay=false
'';
# Auto-login configuration (renamed in newer NixOS) # Auto-login configuration (renamed in newer NixOS)
services.displayManager.autoLogin = { services.displayManager.autoLogin = {
@@ -1228,14 +1244,12 @@ isoConfig
user = "workshop"; user = "workshop";
}; };
# Disable GNOME welcome tour and configure favorite apps # Configure GNOME favorite apps and disable welcome dialog
services.xserver.desktopManager.gnome = { services.xserver.desktopManager.gnome = {
extraGSettingsOverrides = '' extraGSettingsOverrides = ''
[org.gnome.tour] [org.gnome.shell]
enable-autostart=false favorite-apps=['org.gnome.TextEditor.desktop', 'org.gnome.Console.desktop', 'firefox.desktop']
welcome-dialog-last-shown-version='999999'
[org.gnome.shell] '';
favorite-apps=['org.gnome.TextEditor.desktop', 'org.gnome.Terminal.desktop', 'firefox.desktop', 'chromium-browser.desktop'] };
'';
};
} }

View File

@@ -113,10 +113,7 @@
"-device" "-device"
"virtio-net,netdev=net0" "virtio-net,netdev=net0"
]; ];
# Keep GUI session commands for when GUI is used # GUI session commands handled in common.nix
services.xserver.displayManager.sessionCommands = ''
${pkgs.gnome-terminal}/bin/gnome-terminal --maximize --title="Workshop Terminal" &
'';
} }
) )
]; ];