Monorepo for wisp.place. A static site hosting service built on top of the AT Protocol.

BIG changes

+650 -161
+3 -3
apps/main-app/public/editor/tabs/CLITab.tsx
··· 71 71 </a> 72 72 <div className="text-xs text-muted-foreground"> 73 73 <span className="font-mono"> 74 - SHA-1: 69de880e160a2f26e3c26b7c28030457913754dc 74 + SHA-1: 912f8f99c2b55ca6ad75e0a89903688bd2c1cb4b 75 75 </span> 76 76 </div> 77 77 </div> ··· 87 87 </a> 88 88 <div className="text-xs text-muted-foreground"> 89 89 <span className="font-mono"> 90 - SHA-1: 026189f2c10077a2be4705102e169e66cb207f84 90 + SHA-1: ef1992d8850f8fef1d719e4e8fab5431475c352e 91 91 </span> 92 92 </div> 93 93 </div> ··· 103 103 </a> 104 104 <div className="text-xs text-muted-foreground"> 105 105 <span className="font-mono"> 106 - SHA-1: 4777cff07558906717402484a3313359880eae96 106 + SHA-1: 3018dde8fec495abcae044079564ced93cdeb4f8 107 107 </span> 108 108 </div> 109 109 </div>
-59
backup.nix
··· 1 - { 2 - inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; 3 - inputs.nci.url = "github:90-008/nix-cargo-integration"; 4 - inputs.nci.inputs.nixpkgs.follows = "nixpkgs"; 5 - inputs.parts.url = "github:hercules-ci/flake-parts"; 6 - inputs.parts.inputs.nixpkgs-lib.follows = "nixpkgs"; 7 - inputs.fenix = { 8 - url = "github:nix-community/fenix"; 9 - inputs.nixpkgs.follows = "nixpkgs"; 10 - }; 11 - 12 - outputs = inputs @ { 13 - parts, 14 - nci, 15 - ... 16 - }: 17 - parts.lib.mkFlake {inherit inputs;} { 18 - systems = ["x86_64-linux" "aarch64-darwin"]; 19 - imports = [ 20 - nci.flakeModule 21 - ./crates.nix 22 - ]; 23 - perSystem = { 24 - pkgs, 25 - config, 26 - ... 27 - }: let 28 - crateOutputs = config.nci.outputs."wisp-cli"; 29 - mkRenamedPackage = name: pkg: isWindows: pkgs.runCommand name {} '' 30 - mkdir -p $out/bin 31 - if [ -f ${pkg}/bin/wisp-cli.exe ]; then 32 - cp ${pkg}/bin/wisp-cli.exe $out/bin/${name} 33 - elif [ -f ${pkg}/bin/wisp-cli ]; then 34 - cp ${pkg}/bin/wisp-cli $out/bin/${name} 35 - else 36 - echo "Error: Could not find wisp-cli binary in ${pkg}/bin/" 37 - ls -la ${pkg}/bin/ || true 38 - exit 1 39 - fi 40 - ''; 41 - in { 42 - devShells.default = crateOutputs.devShell; 43 - packages.default = crateOutputs.packages.release; 44 - packages.wisp-cli-x86_64-linux = mkRenamedPackage "wisp-cli-x86_64-linux" crateOutputs.packages.release false; 45 - packages.wisp-cli-aarch64-linux = mkRenamedPackage "wisp-cli-aarch64-linux" crateOutputs.allTargets."aarch64-unknown-linux-gnu".packages.release false; 46 - packages.wisp-cli-x86_64-windows = mkRenamedPackage "wisp-cli-x86_64-windows.exe" crateOutputs.allTargets."x86_64-pc-windows-gnu".packages.release true; 47 - packages.wisp-cli-aarch64-darwin = mkRenamedPackage "wisp-cli-aarch64-darwin" crateOutputs.allTargets."aarch64-apple-darwin".packages.release false; 48 - packages.all = pkgs.symlinkJoin { 49 - name = "wisp-cli-all"; 50 - paths = [ 51 - config.packages.wisp-cli-x86_64-linux 52 - config.packages.wisp-cli-aarch64-linux 53 - config.packages.wisp-cli-x86_64-windows 54 - config.packages.wisp-cli-aarch64-darwin 55 - ]; 56 - }; 57 - }; 58 - }; 59 - }
+396
cli/binaries/index.html
··· 1 + <!DOCTYPE html> 2 + <html lang="en"> 3 + <head> 4 + <meta charset="UTF-8"> 5 + <meta name="viewport" content="width=device-width, initial-scale=1.0"> 6 + <title>Wisp CLI - Download</title> 7 + <link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism.min.css" rel="stylesheet" /> 8 + <link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-tomorrow.min.css" rel="stylesheet" media="(prefers-color-scheme: dark)" /> 9 + <style> 10 + :root { 11 + /* Light theme */ 12 + --demo-bg: #eeeeee; 13 + --demo-text: #1a1a1a; 14 + --demo-text-secondary: #666; 15 + --demo-border: #ddd; 16 + --demo-input-bg: #fff; 17 + --demo-button-bg: #0066cc; 18 + --demo-button-text: #fff; 19 + --demo-code-bg: #f5f5f5; 20 + --demo-code-border: #e0e0e0; 21 + --demo-hr: #e0e0e0; 22 + } 23 + 24 + /* Dark theme */ 25 + @media (prefers-color-scheme: dark) { 26 + :root { 27 + --demo-bg: #1a1a1a; 28 + --demo-text: #e0e0e0; 29 + --demo-text-secondary: #999; 30 + --demo-border: #444; 31 + --demo-input-bg: #2a2a2a; 32 + --demo-button-bg: #0066cc; 33 + --demo-button-text: #fff; 34 + --demo-code-bg: #2a2a2a; 35 + --demo-code-border: #444; 36 + --demo-hr: #444; 37 + } 38 + } 39 + 40 + * { 41 + margin: 0; 42 + padding: 0; 43 + box-sizing: border-box; 44 + } 45 + 46 + body { 47 + margin: 0; 48 + padding: 0; 49 + background: var(--demo-bg); 50 + color: var(--demo-text); 51 + transition: background-color 200ms ease, color 200ms ease; 52 + font-family: system-ui, sans-serif; 53 + line-height: 1.6; 54 + } 55 + 56 + .container { 57 + max-width: 860px; 58 + margin: 40px auto; 59 + padding: 0 20px; 60 + min-height: 100vh; 61 + } 62 + 63 + h1 { 64 + margin-top: 0; 65 + color: var(--demo-text); 66 + font-size: 2.5rem; 67 + margin-bottom: 0.5rem; 68 + } 69 + 70 + .subtitle { 71 + color: var(--demo-text-secondary); 72 + font-size: 1.1rem; 73 + margin-bottom: 2rem; 74 + line-height: 1.4; 75 + } 76 + 77 + .description { 78 + margin-bottom: 2rem; 79 + line-height: 1.6; 80 + color: var(--demo-text); 81 + } 82 + 83 + hr { 84 + margin: 32px 0; 85 + border: none; 86 + border-top: 1px solid var(--demo-hr); 87 + } 88 + 89 + h2 { 90 + color: var(--demo-text); 91 + margin-bottom: 1rem; 92 + margin-top: 2rem; 93 + font-size: 1.5rem; 94 + } 95 + 96 + h3 { 97 + color: var(--demo-text); 98 + margin-bottom: 0.75rem; 99 + margin-top: 1.5rem; 100 + font-size: 1.2rem; 101 + } 102 + 103 + .downloads { 104 + background: var(--demo-code-bg); 105 + border: 1px solid var(--demo-code-border); 106 + border-radius: 8px; 107 + padding: 2rem; 108 + margin-bottom: 2rem; 109 + } 110 + 111 + .downloads h2 { 112 + margin-top: 0; 113 + } 114 + 115 + .download-link { 116 + display: block; 117 + background: var(--demo-button-bg); 118 + color: var(--demo-button-text); 119 + text-decoration: none; 120 + padding: 12px 16px; 121 + border-radius: 8px; 122 + margin-bottom: 8px; 123 + transition: opacity 0.2s; 124 + font-family: 'Monaco', 'Menlo', 'Courier New', monospace; 125 + font-size: 0.9rem; 126 + } 127 + 128 + .download-link:hover { 129 + opacity: 0.85; 130 + } 131 + 132 + .platform { 133 + font-weight: bold; 134 + margin-right: 0.5rem; 135 + } 136 + 137 + .cicd-section { 138 + margin-top: 2rem; 139 + } 140 + 141 + .cicd-section h2 { 142 + margin-top: 0; 143 + } 144 + 145 + .cicd-section > p { 146 + color: var(--demo-text-secondary); 147 + margin-bottom: 1rem; 148 + } 149 + 150 + pre { 151 + background: var(--demo-code-bg) !important; 152 + border: 1px solid var(--demo-code-border); 153 + padding: 1.5rem !important; 154 + border-radius: 8px; 155 + overflow-x: auto; 156 + font-size: 0.85rem; 157 + line-height: 1.5; 158 + margin: 1rem 0; 159 + } 160 + 161 + pre code { 162 + color: var(--demo-text); 163 + background: none !important; 164 + padding: 0 !important; 165 + text-shadow: none !important; 166 + } 167 + 168 + code { 169 + font-family: 'Monaco', 'Menlo', 'Courier New', monospace; 170 + } 171 + 172 + .note { 173 + background: var(--demo-code-bg); 174 + border-left: 4px solid var(--demo-button-bg); 175 + border: 1px solid var(--demo-code-border); 176 + border-left: 4px solid var(--demo-button-bg); 177 + padding: 1rem; 178 + margin-top: 1rem; 179 + border-radius: 4px; 180 + } 181 + 182 + .note strong { 183 + color: var(--demo-text); 184 + } 185 + 186 + .note code { 187 + background: var(--demo-input-bg); 188 + padding: 2px 6px; 189 + border-radius: 4px; 190 + border: 1px solid var(--demo-border); 191 + } 192 + 193 + a { 194 + color: var(--demo-button-bg); 195 + text-decoration: none; 196 + } 197 + 198 + a:hover { 199 + text-decoration: underline; 200 + } 201 + 202 + .features { 203 + margin: 2rem 0; 204 + } 205 + 206 + .features ul { 207 + list-style: none; 208 + padding-left: 0; 209 + } 210 + 211 + .features li { 212 + padding: 0.5rem 0; 213 + padding-left: 1.5rem; 214 + position: relative; 215 + line-height: 1.6; 216 + } 217 + 218 + .features li:before { 219 + content: "✓"; 220 + position: absolute; 221 + left: 0; 222 + color: var(--demo-button-bg); 223 + font-weight: bold; 224 + } 225 + 226 + .footer { 227 + margin-top: 3rem; 228 + padding-top: 2rem; 229 + border-top: 1px solid var(--demo-hr); 230 + text-align: center; 231 + color: var(--demo-text-secondary); 232 + } 233 + </style> 234 + </head> 235 + <body> 236 + <div class="container"> 237 + <h1>Wisp CLI <span style="font-size: 1.5rem; color: var(--demo-text-secondary);">v0.5.0</span></h1> 238 + <p class="subtitle">Deploy static sites to the AT Protocol</p> 239 + 240 + <div class="description"> 241 + <p> 242 + The Wisp CLI is a command-line tool for deploying static websites directly to your AT Protocol account. 243 + Host your sites on <a href="https://wisp.place" target="_blank">wisp.place</a> with full ownership and control, 244 + backed by the decentralized AT Protocol. 245 + </p> 246 + </div> 247 + 248 + <div class="features"> 249 + <h2>Features</h2> 250 + <ul> 251 + <li><strong>Deploy:</strong> Push static sites directly from your terminal</li> 252 + <li><strong>Pull:</strong> Download sites from the PDS for development or backup</li> 253 + <li><strong>Serve:</strong> Run a local server with real-time firehose updates</li> 254 + <li>Authenticate with app password or OAuth</li> 255 + </ul> 256 + </div> 257 + 258 + <div class="downloads"> 259 + <h2>Download v0.5.0</h2> 260 + <a href="https://sites.wisp.place/nekomimi.pet/wisp-cli-binaries/wisp-cli-aarch64-darwin" class="download-link" download> 261 + <span class="platform">macOS (Apple Silicon):</span> wisp-cli-aarch64-darwin 262 + </a> 263 + <a href="https://sites.wisp.place/nekomimi.pet/wisp-cli-binaries/wisp-cli-aarch64-linux" class="download-link" download> 264 + <span class="platform">Linux (ARM64):</span> wisp-cli-aarch64-linux 265 + </a> 266 + <a href="https://sites.wisp.place/nekomimi.pet/wisp-cli-binaries/wisp-cli-x86_64-linux" class="download-link" download> 267 + <span class="platform">Linux (x86_64):</span> wisp-cli-x86_64-linux 268 + </a> 269 + <h3 style="margin-top: 1.5rem; margin-bottom: 0.5rem;">SHA-1 Checksums</h3> 270 + <pre style="font-size: 0.75rem; padding: 1rem;"><code class="language-bash">912f8f99c2b55ca6ad75e0a89903688bd2c1cb4b wisp-cli-aarch64-darwin 271 + ef1992d8850f8fef1d719e4e8fab5431475c352e wisp-cli-aarch64-linux 272 + 3018dde8fec495abcae044079564ced93cdeb4f8 wisp-cli-x86_64-linux</code></pre> 273 + </div> 274 + 275 + <div class="cicd-section"> 276 + <h2>CI/CD Integration</h2> 277 + <p>Deploy automatically on every push using <a href="https://blog.tangled.org/ci" target="_blank">Tangled Spindle</a>:</p> 278 + 279 + <pre><code class="language-yaml">when: 280 + - event: ['push'] 281 + branch: ['main'] 282 + - event: ['manual'] 283 + 284 + engine: 'nixery' 285 + 286 + clone: 287 + skip: false 288 + depth: 1 289 + submodules: false 290 + 291 + dependencies: 292 + nixpkgs: 293 + - nodejs 294 + - coreutils 295 + - curl 296 + github:NixOS/nixpkgs/nixpkgs-unstable: 297 + - bun 298 + 299 + environment: 300 + SITE_PATH: 'dist' 301 + SITE_NAME: 'my-site' 302 + WISP_HANDLE: 'your-handle.bsky.social' 303 + 304 + steps: 305 + - name: build site 306 + command: | 307 + export PATH="$HOME/.nix-profile/bin:$PATH" 308 + 309 + # regenerate lockfile, https://github.com/npm/cli/pull/8184 makes rolldown not install 310 + rm package-lock.json bun.lock 311 + bun install @rolldown/binding-linux-arm64-gnu --save-optional 312 + bun install 313 + 314 + # run directly with bun because of shebang issues in nix 315 + bun node_modules/.bin/vite build 316 + 317 + - name: deploy to wisp 318 + command: | 319 + # Download Wisp CLI 320 + curl https://sites.wisp.place/nekomimi.pet/wisp-cli-binaries/wisp-cli-x86_64-linux -o wisp-cli 321 + chmod +x wisp-cli 322 + 323 + # Deploy to Wisp 324 + ./wisp-cli \ 325 + "$WISP_HANDLE" \ 326 + --path "$SITE_PATH" \ 327 + --site "$SITE_NAME" \ 328 + --password "$WISP_APP_PASSWORD"</code></pre> 329 + 330 + <div class="note"> 331 + <strong>Note:</strong> Set <code>WISP_APP_PASSWORD</code> as a secret in your Tangled Spindle repository settings. 332 + Generate an app password from your AT Protocol account settings. 333 + </div> 334 + </div> 335 + 336 + <div class="cicd-section"> 337 + <h2>Basic Usage</h2> 338 + 339 + <h3>Deploy a Site</h3> 340 + <pre><code class="language-bash"># Download and make executable 341 + curl -O https://sites.wisp.place/nekomimi.pet/wisp-cli-binaries/wisp-cli-aarch64-darwin 342 + chmod +x wisp-cli-aarch64-darwin 343 + 344 + # Deploy your site 345 + ./wisp-cli-aarch64-darwin deploy your-handle.bsky.social \ 346 + --path ./dist \ 347 + --site my-site \ 348 + 349 + # Your site will be available at: 350 + # https://sites.wisp.place/your-handle/my-site</code></pre> 351 + 352 + <h3>Pull a Site from PDS</h3> 353 + <p style="color: var(--demo-text-secondary); margin-bottom: 0.5rem;">Download a site from the PDS to your local machine (uses OAuth authentication):</p> 354 + <pre><code class="language-bash"># Pull a site to a specific directory 355 + wisp-cli pull your-handle.bsky.social \ 356 + --site my-site \ 357 + --output ./my-site 358 + 359 + # Pull to current directory 360 + wisp-cli pull your-handle.bsky.social \ 361 + --site my-site 362 + </code></pre> 363 + <h3>Serve a Site Locally with Real-Time Updates</h3> 364 + <p style="color: var(--demo-text-secondary); margin-bottom: 0.5rem;">Run a local server that monitors the firehose for real-time updates (uses OAuth authentication):</p> 365 + <pre><code class="language-bash"># Serve on http://localhost:8080 (default) 366 + wisp-cli serve your-handle.bsky.social \ 367 + --site my-site 368 + 369 + # Serve on a custom port 370 + wisp-cli serve your-handle.bsky.social \ 371 + --site my-site \ 372 + --port 3000 373 + 374 + # Downloads site, serves it, and watches firehose for live updates! 375 + 376 + # Enable SPA mode (serve index.html for all routes) 377 + wisp-cli serve your-handle.bsky.social \ 378 + --site my-site \ 379 + --spa 380 + 381 + # Enable directory listing for paths without index files 382 + wisp-cli serve your-handle.bsky.social \ 383 + --site my-site \ 384 + --directory</code></pre> 385 + </div> 386 + 387 + <div class="footer"> 388 + <p>Learn more at <a href="https://wisp.place">wisp.place</a></p> 389 + </div> 390 + </div> 391 + <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-core.min.js"></script> 392 + <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/autoloader/prism-autoloader.min.js"></script> 393 + <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-bash.min.js"></script> 394 + <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-yaml.min.js"></script> 395 + </body> 396 + </html>
cli/binaries/wisp-cli-aarch64-darwin

This is a binary file and will not be displayed.

cli/binaries/wisp-cli-aarch64-linux

This is a binary file and will not be displayed.

cli/binaries/wisp-cli-x86_64-linux

This is a binary file and will not be displayed.

+1 -1
cli/build-macos.sh
··· 12 12 13 13 echo "Building macOS arm64 binary." 14 14 RUSTFLAGS="-C target-feature=+crt-static" cargo build --release --target aarch64-apple-darwin 15 - cp target/aarch64-apple-darwin/release/wisp-cli binaries/wisp-cli-macos-arm64 15 + cp target/aarch64-apple-darwin/release/wisp-cli binaries/wisp-cli-aarch64-darwin
-90
crates.nix
··· 1 - {...}: { 2 - perSystem = { 3 - pkgs, 4 - config, 5 - lib, 6 - inputs', 7 - ... 8 - }: { 9 - # declare projects 10 - nci.projects."wisp-place-cli" = { 11 - path = ./cli; 12 - export = false; 13 - }; 14 - nci.toolchains.mkBuild = _: 15 - with inputs'.fenix.packages; 16 - combine [ 17 - minimal.rustc 18 - minimal.cargo 19 - targets.x86_64-pc-windows-gnu.latest.rust-std 20 - targets.x86_64-unknown-linux-gnu.latest.rust-std 21 - targets.aarch64-apple-darwin.latest.rust-std 22 - targets.aarch64-unknown-linux-gnu.latest.rust-std 23 - ]; 24 - # configure crates 25 - nci.crates."wisp-cli" = { 26 - profiles = { 27 - dev.runTests = false; 28 - release.runTests = false; 29 - }; 30 - targets."x86_64-unknown-linux-gnu" = let 31 - targetPkgs = pkgs.pkgsCross.gnu64; 32 - targetCC = targetPkgs.stdenv.cc; 33 - targetCargoEnvVarTarget = targetPkgs.stdenv.hostPlatform.rust.cargoEnvVarTarget; 34 - in rec { 35 - default = true; 36 - depsDrvConfig.mkDerivation = { 37 - nativeBuildInputs = [targetCC]; 38 - }; 39 - depsDrvConfig.env = rec { 40 - TARGET_CC = "${targetCC.targetPrefix}cc"; 41 - "CARGO_TARGET_${targetCargoEnvVarTarget}_LINKER" = TARGET_CC; 42 - }; 43 - drvConfig = depsDrvConfig; 44 - }; 45 - targets."x86_64-pc-windows-gnu" = let 46 - targetPkgs = pkgs.pkgsCross.mingwW64; 47 - targetCC = targetPkgs.stdenv.cc; 48 - targetCargoEnvVarTarget = targetPkgs.stdenv.hostPlatform.rust.cargoEnvVarTarget; 49 - in rec { 50 - depsDrvConfig.mkDerivation = { 51 - nativeBuildInputs = [targetCC]; 52 - buildInputs = with targetPkgs; [windows.pthreads]; 53 - }; 54 - depsDrvConfig.env = rec { 55 - TARGET_CC = "${targetCC.targetPrefix}cc"; 56 - "CARGO_TARGET_${targetCargoEnvVarTarget}_LINKER" = TARGET_CC; 57 - }; 58 - drvConfig = depsDrvConfig; 59 - }; 60 - targets."aarch64-apple-darwin" = let 61 - targetPkgs = pkgs.pkgsCross.aarch64-darwin; 62 - targetCC = targetPkgs.stdenv.cc; 63 - targetCargoEnvVarTarget = targetPkgs.stdenv.hostPlatform.rust.cargoEnvVarTarget; 64 - in rec { 65 - depsDrvConfig.mkDerivation = { 66 - nativeBuildInputs = [targetCC]; 67 - }; 68 - depsDrvConfig.env = rec { 69 - TARGET_CC = "${targetCC.targetPrefix}cc"; 70 - "CARGO_TARGET_${targetCargoEnvVarTarget}_LINKER" = TARGET_CC; 71 - }; 72 - drvConfig = depsDrvConfig; 73 - }; 74 - targets."aarch64-unknown-linux-gnu" = let 75 - targetPkgs = pkgs.pkgsCross.aarch64-multiplatform; 76 - targetCC = targetPkgs.stdenv.cc; 77 - targetCargoEnvVarTarget = targetPkgs.stdenv.hostPlatform.rust.cargoEnvVarTarget; 78 - in rec { 79 - depsDrvConfig.mkDerivation = { 80 - nativeBuildInputs = [targetCC]; 81 - }; 82 - depsDrvConfig.env = rec { 83 - TARGET_CC = "${targetCC.targetPrefix}cc"; 84 - "CARGO_TARGET_${targetCargoEnvVarTarget}_LINKER" = TARGET_CC; 85 - }; 86 - drvConfig = depsDrvConfig; 87 - }; 88 - }; 89 - }; 90 - }
+8 -8
docs/src/content/docs/cli.md
··· 1 1 --- 2 - title: Wisp CLI 0.4.1 (alpha) 2 + title: Wisp CLI 0.5.0 (alpha) 3 3 description: Command-line tool for deploying static sites to the AT Protocol 4 4 --- 5 5 ··· 19 19 20 20 <div class="downloads"> 21 21 22 - <h2>Download v0.4.1</h2> 22 + <h2>Download v0.5.0</h2> 23 23 24 24 <a href="https://sites.wisp.place/nekomimi.pet/wisp-cli-binaries/wisp-cli-aarch64-darwin" class="download-link" download=""> 25 25 ··· 48 48 <h3 style="margin-top: 1.5rem; margin-bottom: 0.5rem;">SHA-1 Checksums</h3> 49 49 50 50 <pre style="font-size: 0.75rem; padding: 1rem;" class="language-bash" tabindex="0"><code class="language-bash"> 51 - 69de880e160a2f26e3c26b7c28030457913754dc wisp-cli-aarch64-darwin 51 + 912f8f99c2b55ca6ad75e0a89903688bd2c1cb4b wisp-cli-aarch64-darwin 52 52 53 - 026189f2c10077a2be4705102e169e66cb207f84 wisp-cli-aarch64-linux 53 + ef1992d8850f8fef1d719e4e8fab5431475c352e wisp-cli-aarch64-linux 54 54 55 - 4777cff07558906717402484a3313359880eae96 wisp-cli-x86_64-linux 55 + 3018dde8fec495abcae044079564ced93cdeb4f8 wisp-cli-x86_64-linux 56 56 57 57 d6bc789d7fd7c787e5520eb476cee70c97ccb3ce wisp-cli-x86_64-windows.exe 58 58 </code></pre> ··· 117 117 118 118 ```bash 119 119 # Download and make executable 120 - curl -O https://sites.wisp.place/nekomimi.pet/wisp-cli-binaries/wisp-cli-macos-arm64 121 - chmod +x wisp-cli-macos-arm64 120 + curl -O https://sites.wisp.place/nekomimi.pet/wisp-cli-binaries/wisp-cli-aarch64-darwin 121 + chmod +x wisp-cli-aarch64-darwin 122 122 123 123 # Deploy your site 124 - ./wisp-cli-macos-arm64 deploy your-handle.bsky.social \ 124 + ./wisp-cli-aarch64-darwin deploy your-handle.bsky.social \ 125 125 --path ./dist \ 126 126 --site my-site 127 127 ```
+82
flake.lock
··· 1 + { 2 + "nodes": { 3 + "flake-utils": { 4 + "inputs": { 5 + "systems": "systems" 6 + }, 7 + "locked": { 8 + "lastModified": 1731533236, 9 + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", 10 + "owner": "numtide", 11 + "repo": "flake-utils", 12 + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", 13 + "type": "github" 14 + }, 15 + "original": { 16 + "owner": "numtide", 17 + "repo": "flake-utils", 18 + "type": "github" 19 + } 20 + }, 21 + "nixpkgs": { 22 + "locked": { 23 + "lastModified": 1769018530, 24 + "narHash": "sha256-MJ27Cy2NtBEV5tsK+YraYr2g851f3Fl1LpNHDzDX15c=", 25 + "owner": "NixOS", 26 + "repo": "nixpkgs", 27 + "rev": "88d3861acdd3d2f0e361767018218e51810df8a1", 28 + "type": "github" 29 + }, 30 + "original": { 31 + "owner": "NixOS", 32 + "ref": "nixos-unstable", 33 + "repo": "nixpkgs", 34 + "type": "github" 35 + } 36 + }, 37 + "root": { 38 + "inputs": { 39 + "flake-utils": "flake-utils", 40 + "nixpkgs": "nixpkgs", 41 + "rust-overlay": "rust-overlay" 42 + } 43 + }, 44 + "rust-overlay": { 45 + "inputs": { 46 + "nixpkgs": [ 47 + "nixpkgs" 48 + ] 49 + }, 50 + "locked": { 51 + "lastModified": 1769136478, 52 + "narHash": "sha256-8UNd5lmGf8phCr/aKxagJ4kNsF0pCHLish2G4ZKCFFY=", 53 + "owner": "oxalica", 54 + "repo": "rust-overlay", 55 + "rev": "470ee44393bb19887056b557ea2c03fc5230bd5a", 56 + "type": "github" 57 + }, 58 + "original": { 59 + "owner": "oxalica", 60 + "repo": "rust-overlay", 61 + "type": "github" 62 + } 63 + }, 64 + "systems": { 65 + "locked": { 66 + "lastModified": 1681028828, 67 + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 68 + "owner": "nix-systems", 69 + "repo": "default", 70 + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 71 + "type": "github" 72 + }, 73 + "original": { 74 + "owner": "nix-systems", 75 + "repo": "default", 76 + "type": "github" 77 + } 78 + } 79 + }, 80 + "root": "root", 81 + "version": 7 82 + }
+160
flake.nix
··· 1 + { 2 + description = "wisp-cli - Static site hosting CLI for AT Protocol"; 3 + 4 + # === INPUTS === 5 + # These are the dependencies of your flake (like package.json dependencies) 6 + inputs = { 7 + # nixpkgs is the main Nix package repository 8 + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; 9 + 10 + # rust-overlay gives us easy access to Rust toolchains with cross-compilation targets 11 + rust-overlay = { 12 + url = "github:oxalica/rust-overlay"; 13 + inputs.nixpkgs.follows = "nixpkgs"; 14 + }; 15 + 16 + # flake-utils provides helpers for multi-system flakes 17 + flake-utils.url = "github:numtide/flake-utils"; 18 + }; 19 + 20 + # === OUTPUTS === 21 + outputs = { self, nixpkgs, rust-overlay, flake-utils }: 22 + flake-utils.lib.eachDefaultSystem (system: 23 + let 24 + overlays = [ (import rust-overlay) ]; 25 + pkgs = import nixpkgs { inherit system overlays; }; 26 + 27 + # Rust toolchain with cross-compilation targets 28 + rustToolchain = pkgs.rust-bin.stable.latest.default.override { 29 + targets = [ 30 + "x86_64-unknown-linux-musl" 31 + "aarch64-unknown-linux-musl" 32 + "x86_64-apple-darwin" 33 + "aarch64-apple-darwin" 34 + ]; 35 + }; 36 + 37 + version = "0.5.0"; 38 + pname = "wisp-cli"; 39 + 40 + 41 + # Linux cross-compilation (uses zig as linker for musl) 42 + mkLinuxPackage = { target, suffix }: pkgs.stdenv.mkDerivation { 43 + pname = "${pname}-${suffix}"; 44 + inherit version; 45 + src = ./cli; 46 + 47 + nativeBuildInputs = [ 48 + rustToolchain 49 + pkgs.cargo-zigbuild 50 + pkgs.zig 51 + pkgs.cacert 52 + ]; 53 + 54 + __noChroot = true; 55 + 56 + buildPhase = '' 57 + export HOME=$(mktemp -d) 58 + export CARGO_HOME=$(mktemp -d) 59 + export SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt 60 + export CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C target-feature=+crt-static" 61 + export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C target-feature=+crt-static" 62 + cargo zigbuild --release --target ${target} 63 + ''; 64 + 65 + installPhase = '' 66 + mkdir -p $out/bin 67 + cp target/${target}/release/${pname} $out/bin/${pname} 68 + ''; 69 + 70 + dontConfigure = true; 71 + dontFixup = true; 72 + }; 73 + 74 + # macOS builds (native cargo) 75 + mkDarwinPackage = { target, suffix }: pkgs.stdenv.mkDerivation { 76 + pname = "${pname}-${suffix}"; 77 + inherit version; 78 + src = ./cli; 79 + 80 + nativeBuildInputs = [ rustToolchain pkgs.cacert ]; 81 + 82 + __noChroot = true; 83 + 84 + buildPhase = '' 85 + export HOME=$(mktemp -d) 86 + export CARGO_HOME=$(mktemp -d) 87 + export SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt 88 + cargo build --release --target ${target} 89 + ''; 90 + 91 + installPhase = '' 92 + mkdir -p $out/bin 93 + cp target/${target}/release/${pname} $out/bin/${pname} 94 + ''; 95 + 96 + dontConfigure = true; 97 + dontFixup = true; 98 + }; 99 + 100 + # Cross-compiled packages 101 + linux-x86_64 = mkLinuxPackage { 102 + target = "x86_64-unknown-linux-musl"; 103 + suffix = "linux-x86_64"; 104 + }; 105 + 106 + linux-aarch64 = mkLinuxPackage { 107 + target = "aarch64-unknown-linux-musl"; 108 + suffix = "linux-aarch64"; 109 + }; 110 + 111 + macos-x86_64 = mkDarwinPackage { 112 + target = "x86_64-apple-darwin"; 113 + suffix = "macos-x86_64"; 114 + }; 115 + 116 + macos-aarch64 = mkDarwinPackage { 117 + target = "aarch64-apple-darwin"; 118 + suffix = "macos-aarch64"; 119 + }; 120 + 121 + # Build all targets and collect binaries 122 + all = pkgs.stdenv.mkDerivation { 123 + pname = "${pname}-all"; 124 + inherit version; 125 + dontUnpack = true; 126 + 127 + installPhase = '' 128 + mkdir -p $out 129 + cp ${linux-x86_64}/bin/${pname} $out/${pname}-linux-x86_64 130 + cp ${linux-aarch64}/bin/${pname} $out/${pname}-linux-aarch64 131 + cp ${macos-x86_64}/bin/${pname} $out/${pname}-macos-x86_64 132 + cp ${macos-aarch64}/bin/${pname} $out/${pname}-macos-aarch64 133 + ''; 134 + }; 135 + 136 + # Pick the right default based on current system 137 + default = { 138 + "x86_64-linux" = linux-x86_64; 139 + "aarch64-linux" = linux-aarch64; 140 + "x86_64-darwin" = macos-x86_64; 141 + "aarch64-darwin" = macos-aarch64; 142 + }.${system}; 143 + 144 + in { 145 + packages = { 146 + inherit default linux-x86_64 linux-aarch64 macos-x86_64 macos-aarch64 all; 147 + }; 148 + 149 + devShells.default = pkgs.mkShell { 150 + buildInputs = [ 151 + rustToolchain 152 + pkgs.cargo-zigbuild 153 + pkgs.zig 154 + pkgs.rust-analyzer 155 + ]; 156 + # Darwin stdenv includes SDK with frameworks and libiconv automatically 157 + }; 158 + } 159 + ); 160 + }