Skip to content

Feature/nixified build - #132

Merged
Ocramius merged 6 commits into
sourcefrom
feature/nixified-build
Feb 22, 2026
Merged

Feature/nixified build#132
Ocramius merged 6 commits into
sourcefrom
feature/nixified-build

Conversation

@Ocramius

Copy link
Copy Markdown
Owner

No description provided.

The base rationale is that I'm sick of dealing with breaking dependency upgrades,
especially for a static site.

This site will be frozen in time, and only change when GIT sources change: any
dependencies will be rebuilt via Nix, if needed.

Note that, to make this work:

* the joind.in integration is gone (it performs build-time querying of the joind.in API)
* a new `composer-env.nix` and `php-packages.nix` are introduced, generated by `composer2nix` ( https://github.com/svanderburg/composer2nix/blob/299caca4aac42d7639a42eb4dde951c010f6e91c/README.md )
* at each change of `composer.json`, `nix run .#update-php-packages` is needed

The next step is slapping the result of this derivation into a hardened container.
This also removes `Makefile`, which clashes with the behavior of `pkgs.stdenv.mkDerivation`
@Ocramius Ocramius self-assigned this Feb 22, 2026
…llisions

Fixes:

```
error: Cannot build '/nix/store/pks2xqryrsapdicg6rfffbk2q9svihia-embedded-server.drv'.
       Reason: builder failed with exit code 1.
       Output paths:
         /nix/store/plsxwlxwggzy74fi164zyna809qk4cw1-embedded-server
       Last 9 log lines:
       > Running phase: unpackPhase
       > unpacking source archive /nix/store/whja0bpps2x85f3wznxp6q0l0sskdzcm-caddy-module-with-assets
       > source root is caddy-module-with-assets
       > Running phase: patchPhase
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > Running phase: buildPhase
       > Building subPackage .
       > package github.com/mholt/caddy-embed: case-insensitive file name collision: "files/blog/tags/Clean Code/index.html" and "files/blog/tags/clean code/index.html"
       For full logs, run:
         nix log /nix/store/pks2xqryrsapdicg6rfffbk2q9svihia-embedded-server.drv
```
Comment thread app/SculpinKernel.php
Comment thread caddy-embed/Caddyfile
Comment on lines +7 to +9
# log access_logs {
# level DEBUG
# }

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure about the logging level I want

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will leave this as-is, for now: self-hosting is to be done sometime this year, but the container is ready 👍

Comment thread flake.nix
@Ocramius

Copy link
Copy Markdown
Owner Author
❯ wrk -t 10 -d 30 -c 10  http://localhost:8080/
Running 30s test @ http://localhost:8080/
  10 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   165.35us   75.09us   3.91ms   90.49%
    Req/Sec     6.12k   365.53     7.05k    92.46%
  1833101 requests in 30.10s, 23.32GB read
Requests/sec:  60901.74
Transfer/sec:    793.44MB

I think this will be fine living on my NUC: uses 41Mb of RAM to exist, and contains the entire blog.

I have no idea why Caddy ships with this existing by default in first place: it
is such a gigantic foot-gun.
@Ocramius
Ocramius merged commit 0b9a435 into source Feb 22, 2026
2 checks passed
@Ocramius
Ocramius deleted the feature/nixified-build branch February 22, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant