Expressions to change the world (just a tiny bit)
Hercules CI Effects as implemented by the agent are a fairly low-level interface for executing programs that interact with the Nix store, centralized state and the real world.
This repository provides useful abstractions and implementations to automate tasks such as deployment.
- You've built your repo's
ci.nixon Hercules CI
-
Import this repo in a project where you want to automate something.
-
Expose the return value of one of the functions below as an attribute in your
ci.nix.
See the NixOS deployment guide for an example.
See the Nix Functions Reference and Bash Functions Reference on the documentation site.
Here's an example:
#ci.nix
{ src ? { ref = null; } }: {
production = runIf (src.ref == "refs/heads/master") (
effects.runNixOps {
name = "production";
src = pkgs.lib.cleanSource ./.; # NixOps reads your Nix files
networkFiles = ["network.nix"];
secretsMap.aws = "production-aws";
}
);
}Distributed under the Apache License Version 2.0. See LICENSE for more information.
Email: [email protected] Twitter: @hercules_ci