Repository Setup
Hercules CI is configured "by convention" using .nix files in your repository.
Follow these steps to ensure a correct setup.
-
Clone your repository
-
Write a Nix file. Hercules CI will look for
nix/ci.nix,ci.nixordefault.nixin the root of the repository.The reference has a chapter about evaluation.
-
Use pinned dependencies instead of
<nixpkgs>or similar.Hercules CI uses an empty
NIX_PATHto help with evaluation reproducibility.The unofficial NixOS wiki has a basic method of pinning Nixpkgs.
You can use an impure evaluation-time fetcher such as
builtins.fetchTarball. Note that this makes your evaluation unreproducible if the URL’s resource is mutable. -
Optionally, test locally with
nix-instantiateThe behavior of
nix-instantiateserves as a reference for evaluation in Hercules CI. You may use the following command to test locally:$ NIX_PATH="" nix-instantiate nix/ci.nixshellThis may produce a lot of output if you are using import from derivation. You may run it twice for clarity.
-
Commit and push
-
Check the attributes via the GitHub commit status or the dashboard. If necessary, see