ix.buildSvelteSite packages Svelte builds, previews, and dev servers

ix.buildSvelteSite is now the shared builder for the repo’s Svelte/Vite surfaces: the docs site and resource monitor site. It owns the locked production build, a static preview command, and a checkout dev-server command from one Nix call.

ix.buildSvelteSite pkgs {
  pname = "site";
  src = siteSrc;
  serve.port = 8080;
  devServer = {
    name = "site-dev";
    checkoutSubdir = "site";
    port = 5173;
  };
}

The build still runs from a filtered, tracked source closure. The preview command serves the immutable output with miniserve, so nix run .#site exercises the same files the package embeds. The dev command runs from the mutable checkout instead:

nix run .#site-dev

That split is deliberate. Vite’s dev server writes dependency installs, caches, and HMR state, while Nix builds should stay pure and reproducible. The -dev wrappers install node_modules when missing, pass Vite’s --host and --port flags, and leave ignored files in the checkout where editors and file watchers expect them.

For OrbStack and VM workflows, the builder stops at the command boundary. OrbStack already provides macOS-to-Linux bind mounts, port forwarding, and faster Linux-side volumes for heavier dependency trees. When an ix shell workspace needs ignored files copied after a tracked source sync, nix run .#ix-shell-sync-ignored -- <vm> <path> streams only the git-ignored paths into /work/ix.

  • interesting
  • nix
  • svelte
  • vite