{ description = "Beyond the Prompt: Lessons from Building with Claude Code"; inputs = { nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; }; outputs = { self, nixpkgs }: let # Systems to support supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; # Helper function to generate outputs for all systems forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system (import nixpkgs { inherit system; })); # Generate Caddyfile for presentation makeCaddyConfig = pkgs: port: root: pkgs.writeText "Caddyfile" '' :${toString port} { root * ${root} file_server browse encode gzip log { output stdout format console } } ''; # Generate process-compose config makeProcessComposeConfig = pkgs: processes: pkgs.writeText "process-compose.yaml" ( builtins.toJSON { version = "0.5"; inherit processes; } ); in { # Apps for each system apps = forAllSystems (system: pkgs: { # Presentation server present = { type = "app"; program = "${pkgs.writeScript "present" '' #!/usr/bin/env bash set -euo pipefail # Use current working directory for development PRESENTATION_ROOT="$PWD/presentation" if [ ! -d "$PRESENTATION_ROOT" ]; then echo "Error: presentation/ directory not found in current directory" echo "Please run this command from the project root" exit 1 fi # Generate Caddyfile at runtime CADDY_CONFIG=$(mktemp) trap "rm -f $CADDY_CONFIG" EXIT cat > "$CADDY_CONFIG" < "$COMPOSE_CONFIG" < "$PRESENTATION_CADDY_CONFIG" < "$DEMO_CADDY_CONFIG" < "$COMPOSE_CONFIG" <