hydra icon indicating copy to clipboard operation
hydra copied to clipboard

Document how to build a NixOS system toplevel

Open jpds opened this issue 1 year ago • 5 comments
trafficstars

Is your feature request related to a problem? Please describe.

Hydra seems to be great for building nixpkgs, or a subset of this. I've deployed my own Hydra and have my own local S3 cluster and the two work great.

However, I do not wish to build the (multi-TB) entirety of nixpkgs as my systems deployments requires a significantly tiny number of packages within this.

Instead, I'd like to use Hydra to simply build my systems' toplevels and push the relevant artefacts to the S3 store - then my systems can pull those down without having to do any parts of the builds themselves.

However, this usecase isn't documented in the examples.

jpds avatar Feb 25 '24 13:02 jpds

Does services.hydra.useSubstitutes = true; do what you want? https://search.nixos.org/options?channel=unstable&from=0&size=50&sort=relevance&type=packages&query=services.hydra.useSubstitutes

alejandro-angulo avatar Mar 03 '24 02:03 alejandro-angulo

@alejandro-angulo No, that disables the usage of the binary cache within Hydra.

I want to know exactly what I need to stick on my nixosConfigurations.systemName = nixpkgs.lib.nixosSystem in terms of a hydraJob so Hydra can build these.

jpds avatar Mar 03 '24 21:03 jpds

Take a look at https://git.sr.ht/~fd/nix-configs/tree/main/item/hydra.nix

hydraJobs = import ./hydra.nix { inherit inputs outputs; };

9p4 avatar Apr 03 '24 21:04 9p4