Skip to content

hercules-ci/hercules-ci-effects

Folders and files

NameName
Last commit message
Last commit date
Jan 12, 2023
May 3, 2022
Jan 15, 2025
Jan 1, 2025
Feb 15, 2025
May 31, 2023
Oct 14, 2023
Mar 19, 2022
Apr 11, 2023
Jan 13, 2023
Feb 21, 2024
Sep 29, 2020
Mar 15, 2023
Jun 13, 2022
Jun 15, 2023
Dec 4, 2024
Dec 4, 2024
Feb 16, 2023
Jun 15, 2023
Feb 15, 2025
Dec 4, 2024
Feb 11, 2021
May 3, 2022

Repository files navigation

hercules-ci-effects

Expressions to change the world (just a tiny bit)

About the project

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.

Getting started

Prerequisites

  • You've built your repo's ci.nix on Hercules CI

Installation

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

Usage

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";
    }
  );
}

License

Distributed under the Apache License Version 2.0. See LICENSE for more information.

Contact

Email: [email protected] Twitter: @hercules_ci

Acknowledgements