Standardized nix eval & build triggering protocol
Hi guys
I'm wondering if there is a standardized protocol with which for a given reference to a package in a flake at a specific commit i can ask a remote nix eval & build server:
- if it has already evaluated it
- if not, to start evaluating it (and building resulting derivations)
- get the progress of the evaluation & the derivations being built
- get the result of the evaluation (usually just a store path, but could also be JSON, or a string, without any derivations involved)
so for example to get the store path of "github:NixOS/nixpkgs/25e2e47820acbc56e353767588b429d3ac17c6d9#packages.x86_64-linux.cowsay" and also triggering a build for it, without having nix installed on the local machine.
The reason I'm interested in this is that I was looking at Kranzes/nix-store-csi and also at Mic92/flakelet and had the impression that it would be kind of nice, if in both of those cases, the system that wants to run the application (be it kubernetes, or a nixos host), can "request" the build of the application by itself when it detects a new commit, and pull the application from the cache as soon as it's finished.
I've experimented a bit with building a system that does exactly this for nix-store-csi over wavelens/gradient but then realized, it would be much nicer if I wouldn't have to lock into the custom protocol of Gradient and could just use a standard protocol for this, so that i can swap out the build system at any time.
It would be so nice if I could point my kubernetes cluster at a build server and then to, for whatever reference to an application in a flake, go evaluate and build it on that server and then pull it from the cache and deploy it when it's ready. That would make deployment much easier than having a pipeline build a container image, push it to a registry, and then tell kubernetes to deploy it afterwards.
1 like
Mentions
Standardized nix eval & build triggering protocol Hi guys I'm wondering if there is a standardized protocol with which for a given reference to a package in a flake at a specific commit i can ask a remote nix eval & build server: - if it has already evaluated it - if not, to start evaluating it (and building resulting derivations) - get the progress of the evaluation & the derivations being built - get the result of the evaluation (usually just a store path, but could also be JSON, or a string, without any derivations involved) so for example to get the store path of "github:NixOS/nixpkgs/25e2e47820acbc56e353767588b429d3ac17c6d9#packages.x86_64-linux.cowsay" and also triggering a build for it, without having nix installed on the local machine. The reason I'm interested in this is that I was looking at Kranzes/nix-store-csi and also at Mic92/flakelet and had the impression that it would be kind of nice, if in both of those cases, the system that wants to run the application (be it kubernetes, or a nixos host), can "request" the build of the application by itself when it detects a new commit, and pull the application from the cache as soon as it's finished. I've experimented a bit with building a system that does exactly this for nix-store-csi over wavelens/gradient but then realized, it would be much nicer if I wouldn't have to lock into the custom protocol of Gradient and could just use a standard protocol for this, so that i can swap out the build system at any time. It would be so nice if I could point my kubernetes cluster at a build server and then to, for whatever reference to an application in a flake, go evaluate and build it on that server and then pull it from the cache and deploy it when it's ready. That would make deployment much easier than having a pipeline build a container image, push it to a registry, and then tell kubernetes to deploy it afterwards.