feat: Enhance NixOS workshop environment with conditional ISO settings and improved local development commands

This commit is contained in:
2025-08-16 14:42:52 +02:00
parent 66c986c8f1
commit 6c32b42f48
3 changed files with 155 additions and 125 deletions

25
ABRA_RECIPES.md Normal file
View File

@@ -0,0 +1,25 @@
| Recipe | Score | Description | Link |
|---|---|---|---|
| gitea | 5 | Self-hosted Git service | [https://recipes.coopcloud.tech/gitea](https://recipes.coopcloud.tech/gitea) |
| mealie | 5 | Recipe manager and meal planner | [https://recipes.coopcloud.tech/mealie](https://recipes.coopcloud.tech/mealie) |
| nextcloud | 5 | A safe home for all your data | [https://recipes.coopcloud.tech/nextcloud](https://recipes.coopcloud.tech/nextcloud) |
| gotosocial | 4 | Fast and friendly Fediverse server | [https://recipes.coopcloud.tech/gotosocial](https://recipes.coopcloud.tech/gotosocial) |
| wordpress | 4 | Create a beautiful website, blog, or app | [https://recipes.coopcloud.tech/wordpress](https://recipes.coopcloud.tech/wordpress) |
| collabora | 3 | Online Office suite | [https://recipes.coopcloud.tech/collabora](https://recipes.coopcloud.tech/collabora) |
| croc | 3 | Easily and securely send things | [https://recipes.coopcloud.tech/croc](https://recipes.coopcloud.tech/croc) |
| custom-php | 3 | Custom PHP application | [https://recipes.coopcloud.tech/custom-php](https://recipes.coopcloud.tech/custom-php) |
| dokuwiki | 3 | A simple to use and highly versatile Open Source wiki software | [https://recipes.coopcloud.tech/dokuwiki](https://recipes.coopcloud.tech/dokuwiki) |
| engelsystem | 3 | Tool for coordinating helpers and shifts | [https://recipes.coopcloud.tech/engelsystem](https://recipes.coopcloud.tech/engelsystem) |
| fab-manager | 3 | FabLab management software | [https://recipes.coopcloud.tech/fab-manager](https://recipes.coopcloud.tech/fab-manager) |
| ghost | 3 | Publishing platform for professional publishers | [https://recipes.coopcloud.tech/ghost](https://recipes.coopcloud.tech/ghost) |
| karrot | 3 | Web application for grassroots initiatives | [https://recipes.coopcloud.tech/karrot](https://recipes.coopcloud.tech/karrot) |
| lauti | 3 | Calendar software for events | [https://recipes.coopcloud.tech/lauti](https://recipes.coopcloud.tech/lauti) |
| loomio | 3 | Collaborative decision-making tool | [https://recipes.coopcloud.tech/loomio](https://recipes.coopcloud.tech/loomio) |
| mattermost | 3 | Secure collaboration platform | [https://recipes.coopcloud.tech/mattermost](https://recipes.coopcloud.tech/mattermost) |
| mattermost-lts | 3 | Long-term support for Mattermost | [https://recipes.coopcloud.tech/mattermost-lts](https://recipes.coopcloud.tech/mattermost-lts) |
| mrbs | 3 | Meeting Room Booking System | [https://recipes.coopcloud.tech/mrbs](https://recipes.coopcloud.tech/mrbs) |
| onlyoffice | 3 | Office suite for documents | [https://recipes.coopcloud.tech/onlyoffice](https://recipes.coopcloud.tech/onlyoffice) |
| open-inventory | 3 | Open source inventory management | [https://recipes.coopcloud.tech/open-inventory](https://recipes.coopcloud.tech/open-inventory) |
| outline | 3 | Team knowledge base | [https://recipes.coopcloud.tech/outline](https://recipes.coopcloud.tech/outline) |
| owncast | 3 | Self-hosted live video streaming | [https://recipes.coopcloud.tech/owncast](https://recipes.coopcloud.tech/owncast) |
| rallly | 3 | Schedule group meetings | [https://recipes.coopcloud.tech/rallly](https://recipes.coopcloud.tech/rallly) |

View File

@@ -1,10 +1,13 @@
{ pkgs, allParticipantNames, ... }: {
system.stateVersion = "25.05";
isoImage.makeEfiBootable = true;
isoImage.makeUsbBootable = true;
# Conditional ISO image settings
${pkgs.lib.mkIf isLiveIso {
isoImage.makeEfiBootable = true;
isoImage.makeUsbBootable = true;
}}
networking.wireless.enable = true;
networking.wireless.enable = true;
networking.networkmanager.enable = true;
networking.hostName = "workshop-live";
@@ -77,136 +80,135 @@
programs.zsh = {
enable = true;
interactiveShellInit = ''
echo "CODE CRISPIES Workshop Environment"
echo "Mode: Local Development + Cloud Access"
echo ""
echo "🏠 Local Development:"
echo " recipes - Show available app recipes"
echo " deploy <recipe> - Deploy app locally (e.g., deploy wordpress)"
echo " browser - Launch Firefox"
echo " desktop - Start GUI session"
echo ""
echo " Cloud Access:"
echo " Available servers:"
${builtins.concatStringsSep "\n" (map (name:
"echo \" - ${name}.codecrispi.es\""
) allParticipantNames)}
echo " connect <name> - SSH to cloud server"
echo ""
echo "📚 Commands: recipes | deploy | connect | browser | desktop | help"
echo "CODE CRISPIES Workshop Environment"
echo "Mode: Local Development + Cloud Access"
echo ""
echo "🏠 Local Development:"
echo " recipes - Show available app recipes"
echo " deploy <recipe> - Deploy app locally (e.g., deploy wordpress)"
echo " setup-traefik - Setup local Traefik (required first!)"
echo " browser - Launch Firefox"
echo " desktop - Start GUI session"
echo ""
echo " Cloud Access:"
echo " Available servers:"
${builtins.concatStringsSep "\n" (map (name:
"echo \" - ${name}.codecrispi.es\""
) cloudServerNames)}
echo " connect <name> - SSH to cloud server"
echo ""
echo "📚 Commands: setup-traefik | recipes | deploy | connect | browser | desktop | help"
# Ensure abra is in PATH
export PATH="$HOME/.local/bin:$PATH"
# Ensure abra is in PATH
export PATH="$HOME/.local/bin:$PATH"
deploy() {
if [ -z "$1" ]; then
echo "Usage: deploy <recipe>"
echo "Example: deploy wordpress"
echo "Run 'recipes' to see available options"
return 1
fi
deploy() {
if [ -z "$1" ]; then
echo "Usage: deploy <recipe>"
echo "Example: deploy wordpress"
echo "Run 'recipes' to see available options"
return 1
fi
local recipe="$1"
local domain="$recipe.workshop.local"
local recipe="$1"
local domain="$recipe.workshop.local"
echo "🚀 Deploying $recipe locally..."
echo "Domain: $domain"
echo "🚀 Deploying $recipe locally..."
echo "Domain: $domain"
# Check if abra is available
if ! command -v abra &> /dev/null; then
echo " Abra not found. Run 'sudo systemctl restart workshop-abra-setup'"
return 1
fi
# Check if abra is available
if ! command -v abra &> /dev/null; then
echo " Abra not found. Run 'sudo systemctl restart workshop-abra-setup'"
return 1
fi
# Deploy with abra
abra app new "$recipe" -S --domain="$domain"
abra app deploy "$domain"
# Deploy with abra
abra app new "$recipe" -S --domain="$domain"
abra app deploy "$domain"
echo " Deployed! Access at: http://$domain"
echo "🌐 Open browser with: browser"
}
echo " Deployed! Access at: http://$domain"
echo "🌐 Open browser with: browser"
}
connect() {
[ -z "$1" ] && { echo "Usage: connect <name>"; return 1; }
echo "Connecting to $1.codecrispi.es..."
ssh -o StrictHostKeyChecking=no workshop@$1.codecrispi.es
}
connect() {
[ -z "$1" ] && { echo "Usage: connect <name>"; return 1; }
echo "Connecting to $1.codecrispi.es..."
ssh -o StrictHostKeyChecking=no workshop@$1.codecrispi.es
}
recipes() {
echo "Available Co-op Cloud Recipes:"
echo ""
echo "📝 Content Management:"
echo " wordpress ghost hedgedoc dokuwiki mediawiki"
echo ""
echo "📁 File & Collaboration:"
echo " nextcloud seafile collabora onlyoffice"
echo ""
echo "💬 Communication:"
echo " jitsi-meet matrix-synapse rocketchat mattermost"
echo ""
echo "🛒 E-commerce & Business:"
echo " prestashop invoiceninja kimai pretix"
echo ""
echo " Development & Tools:"
echo " gitea drone n8n gitlab jupyter-lab"
echo ""
echo "📊 Analytics & Monitoring:"
echo " plausible matomo uptime-kuma grafana"
echo ""
echo "🎵 Media & Social:"
echo " peertube funkwhale mastodon pixelfed jellyfin"
echo ""
echo "🚀 Local Deploy: deploy <recipe>"
echo " Cloud Deploy: connect <server> then use abra commands"
echo "📖 Browse all: https://recipes.coopcloud.tech"
}
recipes() {
echo "Available Co-op Cloud Recipes:"
echo ""
echo "📝 Content Management:"
echo " wordpress ghost hedgedoc dokuwiki mediawiki"
echo ""
echo "📁 File & Collaboration:"
echo " nextcloud seafile collabora onlyoffice"
echo ""
echo "💬 Communication:"
echo " jitsi-meet matrix-synapse rocketchat mattermost"
echo ""
echo "🛒 E-commerce & Business:"
echo " prestashop invoiceninja kimai pretix"
echo ""
echo " Development & Tools:"
echo " gitea drone n8n gitlab jupyter-lab"
echo ""
echo "📊 Analytics & Monitoring:"
echo " plausible matomo uptime-kuma grafana"
echo ""
echo "🎵 Media & Social:"
echo " peertube funkwhale mastodon pixelfed jellyfin"
echo ""
echo "🚀 Local Deploy: deploy <recipe>"
echo " Cloud Deploy: connect <server> then use abra commands"
echo "📖 Browse all: https://recipes.coopcloud.tech"
}
browser() {
echo "🌐 Starting Firefox..."
if [ -n "$DISPLAY" ]; then
firefox &
else
echo " No GUI session. Run 'desktop' first"
fi
}
browser() {
echo "🌐 Starting Firefox..."
if [ -n "$DISPLAY" ]; then
firefox &
else
echo " No GUI session. Run 'desktop' first"
fi
}
desktop() {
echo "🖥 Starting GUI session..."
if [ -z "$DISPLAY" ]; then
startx &
export DISPLAY=:0
sleep 3
echo " GUI started. Run 'browser' to open Firefox"
else
echo " GUI already running"
fi
}
desktop() {
echo "🖥 Starting GUI session..."
if [ -z "$DISPLAY" ]; then
startx &
export DISPLAY=:0
sleep 3
echo " GUI started. Run 'browser' to open Firefox"
else
echo " GUI already running"
fi
}
help() {
echo "CODE CRISPIES Workshop Commands:"
echo ""
echo "🏠 Local Development:"
echo " setup-traefik - Setup local Traefik proxy (required first!)"
echo " recipes - Show all available app recipes"
echo " deploy <recipe> - Deploy app locally (e.g., deploy wordpress)"
echo " browser - Launch Firefox browser"
echo " desktop - Start GUI desktop session"
echo ""
echo " Cloud Access:"
echo " connect <name> - SSH to cloud server (e.g., connect hopper)"
echo ""
echo "Available servers: ${builtins.concatStringsSep " " cloudServerNames}"
echo ""
echo "📚 Learning Flow:"
echo " 1. First time: setup-traefik"
echo " 2. Try local: recipes deploy wordpress browser"
echo " 3. Try cloud: connect hopper same abra commands"
}
help() {
echo "CODE CRISPIES Workshop Commands:"
echo ""
echo "🏠 Local Development:"
echo " recipes - Show all available app recipes"
echo " deploy <recipe> - Deploy app locally (e.g., deploy wordpress)"
echo " browser - Launch Firefox browser"
echo " desktop - Start GUI desktop session"
echo ""
echo " Cloud Access:"
echo " connect <name> - SSH to cloud server (e.g., connect hopper)"
echo ""
echo "🔧 System:"
echo " sudo nmcli dev wifi connect SSID password PASSWORD"
echo " sudo systemctl restart workshop-abra-setup # Reinstall abra"
echo ""
echo "📚 Learning Flow:"
echo " 1. Try local: recipes deploy wordpress browser"
echo " 2. Try cloud: connect hopper same abra commands"
echo ""
echo "Available servers: ${builtins.concatStringsSep " " allParticipantNames}"
}
export -f deploy connect recipes browser desktop help
'';
export -f setup-traefik deploy connect recipes browser desktop help
'';
};
services.xserver = {

View File

@@ -49,9 +49,9 @@
numParticipants;
# Common configuration for both live-iso and local-vm
commonConfig = import ./common.nix {
inherit pkgs allParticipantNames participantNames;
};
commonConfig =
{ isLiveIso ? false, ... } @ args:
import ./common.nix (args // { inherit pkgs allParticipantNames participantNames; });
in
{
packages.${system} = {
@@ -63,6 +63,7 @@
modules = [
commonConfig
{ isLiveIso = true; }
];
};
};
@@ -79,6 +80,7 @@
inherit system;
modules = [
commonConfig
{ isLiveIso = false; }
({ config, pkgs, ... }: {
boot.loader.grub.enable = false;
boot.loader.generic-extlinux-compatible.enable = true;
@@ -108,3 +110,4 @@
};
};
}