Add Nix flake build system with automated container image building:
**Nix Flake (flake.nix)**
- Built with flake-parts for modularity
- `solidhaus` package: builds SvelteKit app with buildNpmPackage
- `solidhaus-image` package: OCI image with nginx serving app
- `push-solidhaus-image` app: pushes to registry.toph.so
- Dev shell with Node.js 22
**OCI Image**
- Based on nixpkgs nginx
- Serves SvelteKit build/ as static SPA
- SPA fallback routing configured
- Security headers (X-Frame-Options, X-Content-Type-Options, X-XSS-Protection)
- Gzip compression for text assets
- 1-year cache for immutable static assets
**Forgejo CI (.forgejo/workflows/build-image.yml)**
- Runs on 'nix' runner (uses nix-runner-image)
- Builds OCI image on every push
- Pushes to registry.toph.so on main branch
- Tags with :latest and :${commit-sha}
**Build commands**
- `nix build .#solidhaus` — build app
- `nix build .#solidhaus-image` — build OCI image
- `nix run .#push-solidhaus-image` — push to registry
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
130 lines
3.4 KiB
JSON
130 lines
3.4 KiB
JSON
{
|
|
"nodes": {
|
|
"flake-parts": {
|
|
"inputs": {
|
|
"nixpkgs-lib": "nixpkgs-lib"
|
|
},
|
|
"locked": {
|
|
"lastModified": 1769996383,
|
|
"narHash": "sha256-AnYjnFWgS49RlqX7LrC4uA+sCCDBj0Ry/WOJ5XWAsa0=",
|
|
"owner": "hercules-ci",
|
|
"repo": "flake-parts",
|
|
"rev": "57928607ea566b5db3ad13af0e57e921e6b12381",
|
|
"type": "github"
|
|
},
|
|
"original": {
|
|
"owner": "hercules-ci",
|
|
"repo": "flake-parts",
|
|
"type": "github"
|
|
}
|
|
},
|
|
"flake-utils": {
|
|
"inputs": {
|
|
"systems": "systems"
|
|
},
|
|
"locked": {
|
|
"lastModified": 1731533236,
|
|
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
|
"owner": "numtide",
|
|
"repo": "flake-utils",
|
|
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
|
"type": "github"
|
|
},
|
|
"original": {
|
|
"owner": "numtide",
|
|
"repo": "flake-utils",
|
|
"type": "github"
|
|
}
|
|
},
|
|
"nixpkgs": {
|
|
"locked": {
|
|
"lastModified": 1771903837,
|
|
"narHash": "sha256-sdaqdnsQCv3iifzxwB22tUwN/fSHoN7j2myFW5EIkGk=",
|
|
"owner": "NixOS",
|
|
"repo": "nixpkgs",
|
|
"rev": "e764fc9a405871f1f6ca3d1394fb422e0a0c3951",
|
|
"type": "github"
|
|
},
|
|
"original": {
|
|
"owner": "NixOS",
|
|
"ref": "nixos-25.11",
|
|
"repo": "nixpkgs",
|
|
"type": "github"
|
|
}
|
|
},
|
|
"nixpkgs-lib": {
|
|
"locked": {
|
|
"lastModified": 1769909678,
|
|
"narHash": "sha256-cBEymOf4/o3FD5AZnzC3J9hLbiZ+QDT/KDuyHXVJOpM=",
|
|
"owner": "nix-community",
|
|
"repo": "nixpkgs.lib",
|
|
"rev": "72716169fe93074c333e8d0173151350670b824c",
|
|
"type": "github"
|
|
},
|
|
"original": {
|
|
"owner": "nix-community",
|
|
"repo": "nixpkgs.lib",
|
|
"type": "github"
|
|
}
|
|
},
|
|
"nixpkgs_2": {
|
|
"locked": {
|
|
"lastModified": 1771848320,
|
|
"narHash": "sha256-0MAd+0mun3K/Ns8JATeHT1sX28faLII5hVLq0L3BdZU=",
|
|
"owner": "NixOS",
|
|
"repo": "nixpkgs",
|
|
"rev": "2fc6539b481e1d2569f25f8799236694180c0993",
|
|
"type": "github"
|
|
},
|
|
"original": {
|
|
"owner": "NixOS",
|
|
"ref": "nixos-unstable",
|
|
"repo": "nixpkgs",
|
|
"type": "github"
|
|
}
|
|
},
|
|
"root": {
|
|
"inputs": {
|
|
"flake-parts": "flake-parts",
|
|
"nixpkgs": "nixpkgs",
|
|
"sd-card": "sd-card"
|
|
}
|
|
},
|
|
"sd-card": {
|
|
"inputs": {
|
|
"flake-utils": "flake-utils",
|
|
"nixpkgs": "nixpkgs_2"
|
|
},
|
|
"locked": {
|
|
"lastModified": 1772146011,
|
|
"narHash": "sha256-ZUj4zAAk9shxYOn5jh9Kri4q5O/Aq52OJF43otPMPBE=",
|
|
"ref": "refs/heads/main",
|
|
"rev": "307eb15035671c58f9145806067030b59c5d7792",
|
|
"revCount": 4,
|
|
"type": "git",
|
|
"url": "ssh://git@git.toph.so/toph/sd-card"
|
|
},
|
|
"original": {
|
|
"type": "git",
|
|
"url": "ssh://git@git.toph.so/toph/sd-card"
|
|
}
|
|
},
|
|
"systems": {
|
|
"locked": {
|
|
"lastModified": 1681028828,
|
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
|
"owner": "nix-systems",
|
|
"repo": "default",
|
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
|
"type": "github"
|
|
},
|
|
"original": {
|
|
"owner": "nix-systems",
|
|
"repo": "default",
|
|
"type": "github"
|
|
}
|
|
}
|
|
},
|
|
"root": "root",
|
|
"version": 7
|
|
}
|