I’m trying to make NixOS installations that I use, more reliable by creating CI/CD pipeline that will build an ISO for me with newest updates and validate if it works. After that, if everything is ok, system update on the production servers will be triggered.
I discovered Hydra as a most Nix-native option to make CI/CD pipelines, but from the docs I’ve seen, it’s only being used(or only suitable) for building NixOS packages.
So I’m wondering, is there’s a way of defining custom scripts for the Hydra jobsets?
Hydra might be quite a heavy weight solution to this problem.This might be a good use for flakes…
seems an excellent guide on build iso’s with flakes… as flakes can continuously track upstream git repo’s and ‘follow’ them, then it should be trivial to script this.
It maybe trivial also build this job with hydra , which seems to be defined in
Sorry for my ignorance at this point, but I’ve tried running through the Hydra Job, that you provided link to, but failed to find a way to scrape a .nix config and spec.json file, describing the job. Could you please, if possible, advise, where should I search for it?
For what it’s worth, I don’t think you’re ignorant, I don’t think hydra is the easiest to use/comprehend or setup. The most helpful thing I can do is just give you pointers, since I just went through this:
Flakes is just some import syntax, it’s not necessary here. You can do declarative jobs, etc, all the same, the hydra config is just slightly different
I think the hydra specs part, where the project is actually configured - I think I still use non-flakes for that (hydra-specs.nix → flakes-compat → #hydraSpecs), but I think hydra supports a flake ref here too, I haven’t tested yet.
Extra random notes, apropos of nothing:
It would be really cool if hydra could decompose flake references and track them. I’d love to see "all hydra jobs where nixcfg was an input, or “show me the inputs and their rev changes that occurred for this instance of a job”. You could see failures based on inputs pop out, etc.
shout out to clever from freenode for the hydralib that I stole to generate the jobspecs
shout out to nixpkgs ‘stdlib’ somewhere where I stole the beginnings of the hydra machine line builder and huge shout out to @grahamc for the pointer about configuring a specific identity key for a given machine (which is now incorporated in the machines-txt-builder helper), and some others I’ve forgotten.