NixOS / hydra

Hydra, the Nix-based continuous build system
http://nixos.org/hydra
GNU General Public License v3.0
1.1k stars 291 forks source link

Document how to build a NixOS system toplevel #1365

Open jpds opened 4 months ago

jpds commented 4 months ago

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.

alejandro-angulo commented 4 months ago

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

jpds commented 4 months ago

@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.

9p4 commented 3 months ago

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

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