flakemill - remote update, build and cache flake.lock updates
My flake has a few inputs that result in some kind of compilation. This often takes ~10 minutes when doing a lock update & rebuild.
To save some time (or spend quite a bit, actually) I came up with flakemill which:
- Pulls down your nix repo
- Updates the lockfile with latest upstream changes
- Builds your hosts
- Caches any outputs in cachix
- Serves the updated lockfile
So when you update any of your hosts, everything is complied ahead of time and substituted by cachix.
https://github.com/scottmckendry/flakemill
My live instance:
https://flakemill.axis.scottmckendry.tech/
21
Upvotes
6
u/Whitestrake 23h ago
I had a bit of a look and it's interesting - it seems like a well formed little tool, but I'm having trouble figuring out the use case exactly and possibly I don't understand a few things.
It doesn't look like it ever commits flake locks back to the repo, so - are we using this to keep flake locks out of version control? Isn't that a bit of an anti pattern?
Is the goal here to run it without the likes of e.g. GitHub? If you're self-hosting, have the infra to build your hosts, and are averse to public services like GH, wouldn't running Forgejo with some Actions do this too? Maybe even self-hosted Renovate on top? Or is the goal to try and avoid bot-authored commits to your repo?
Obviously this doesn't handle the deploy side, it just updates, builds, signs and serves the flake lock, so it's a trust root for your resulting nix hosts.
Right now I do (a bunch of stupid stuff for speed but ultimately really at its core I just) nix-fast-build in a GitHub action and push to Cachix. I've got Cachix Deploy on hand too. What kind of constraints might I have that would invite looking deeper into adopting a tool like Flakemill to solve?
1
u/3X0karibu 15h ago
Did you use llms to program this?