hercules-ci-effects

This module provides

  • a mergeable herculesCI attribute; read by Hercules CI and the hci command,
  • the hci-effects library as a module argument in perSystem / withSystem,
  • ready to go, configurable continuous deployment jobs

Installation

To use these options, add to your flake inputs:

hercules-ci-effects.url = "github:hercules-ci/hercules-ci-effects";

and inside the mkFlake:

imports = [
   inputs.hercules-ci-effects.flakeModule
];

Run nix flake lock and you're set.

Options

defaultEffectSystem

hercules-ci.flake-update.enable

hercules-ci.flake-update.autoMergeMethod

hercules-ci.flake-update.createPullRequest

hercules-ci.flake-update.effect.system

hercules-ci.flake-update.forgeType

hercules-ci.flake-update.updateBranch

hercules-ci.flake-update.when

herculesCI

herculesCI.ciSystems

herculesCI.onPush

herculesCI.onPush.<name>.outputs

herculesCI.onSchedule

herculesCI.onSchedule.<name>.outputs

herculesCI.onSchedule.<name>.when

herculesCI.onSchedule.<name>.when.dayOfMonth

herculesCI.onSchedule.<name>.when.dayOfWeek

herculesCI.onSchedule.<name>.when.hour

herculesCI.onSchedule.<name>.when.minute

herculesCI.repo

herculesCI.repo.branch

herculesCI.repo.forgeType

herculesCI.repo.name

herculesCI.repo.owner

herculesCI.repo.ref

herculesCI.repo.remoteHttpUrl

herculesCI.repo.remoteSshUrl

herculesCI.repo.rev

herculesCI.repo.shortRev

herculesCI.repo.tag

herculesCI.repo.webUrl

perSystem

perSystem.herculesCIEffects.pkgs

defaultEffectSystem

The default system type that some integrations will use to run their effects on.

Type: string

Default: "x86_64-linux"

Declared by:

hercules-ci-effects/flake-modules/herculesCI-helpers.nix

hercules-ci.flake-update.enable

Whether to create a scheduled flake update job.

For a complete example, see the hercules-ci-effects documentation on hercules-ci.flake-update.

Requires hercules-ci-agent 0.9.8 or newer.

Type: boolean

Default: false

Example: true

Declared by:

hercules-ci-effects/effects/flake-update/flake-module.nix

hercules-ci.flake-update.autoMergeMethod

Whether to enable auto-merge on new pull requests, and how to merge it.

This requires GitHub branch protection to be configured for the repository.

Type: one of <null>, "merge", "rebase", "squash"

Default: null

Declared by:

hercules-ci-effects/effects/flake-update/flake-module.nix

hercules-ci.flake-update.createPullRequest

Whether to create a pull request for the updated flake.lock.

Type: boolean

Default: true

Declared by:

hercules-ci-effects/effects/flake-update/flake-module.nix

hercules-ci.flake-update.effect.system

The system on which to run the flake update job.

Type: string

Default: config.defaultEffectSystem

Example: "aarch64-linux"

Declared by:

hercules-ci-effects/effects/flake-update/flake-module.nix

hercules-ci.flake-update.forgeType

The type of Git server commited to.

Type: string

Default: "github"

Example: "gitlab"

Declared by:

hercules-ci-effects/effects/flake-update/flake-module.nix

hercules-ci.flake-update.updateBranch

To which branch to push the updated flake lock.

Type: string

Default: "flake-update"

Example: "update"

Declared by:

hercules-ci-effects/effects/flake-update/flake-module.nix

hercules-ci.flake-update.when

See herculesCI.onSchedule.<name>.when for details.

Type: raw value

Declared by:

hercules-ci-effects/effects/flake-update/flake-module.nix

herculesCI

Hercules CI environment and configuration. See the sub-options for details.

Regarding the implementation: Hercules CI offers a bit more information than flakes by itself, and does so by calling the herculesCI attribute on the flake. The purpose of the top-level herculesCI option in the flake-parts module is to facilitate define this function using declared options.

Type: module

Declared by:

hercules-ci-effects/flake-modules/herculesCI-helpers.nix, hercules-ci-effects/flake-modules/herculesCI-attribute.nix

herculesCI.ciSystems

Flake systems for which to generate attributes in herculesCI.onPush.default.outputs.

Type: list of string

Default: config.systems # from flake parts

Declared by:

hercules-ci-effects/flake-modules/herculesCI-attribute.nix

herculesCI.onPush

This declares what to do when a Git ref is updated, such as when you push a commit or after you merge a pull request.

By default onPush.default defines a job that builds the known flake output attributes. It can be disabled by setting onPush.default.enable = false;.

The name of the job (from onPush.<name>) will be used as part of the commit status of the resulting job.

Type: lazy attribute set of (submodule)

Default: { }

Declared by:

hercules-ci-effects/flake-modules/herculesCI-attribute.nix

herculesCI.onPush.<name>.outputs

A collection of builds and effects. These may be nested recursively into attribute sets.

Hercules CI's traversal of nested sets can be cancelled with lib.dontRecurseIntoAttrs.

See the parent option for details about when the job runs.

Type: a tree of attribute sets and derivations

Declared by:

hercules-ci-effects/flake-modules/herculesCI-attribute.nix

herculesCI.onSchedule

Since hercules-ci-agent 0.9.8

Behaves similar to onPush, but is responsible for jobs that respond to the passing of time rather than to a git push or equivalent.

Type: lazy attribute set of (submodule)

Default: { }

Declared by:

hercules-ci-effects/flake-modules/herculesCI-attribute.nix

herculesCI.onSchedule.<name>.outputs

A collection of builds and effects. These may be nested recursively into attribute sets.

Hercules CI's traversal of nested sets can be cancelled with lib.dontRecurseIntoAttrs.

See the parent option for details about when the job runs.

Type: a tree of attribute sets and derivations

Declared by:

hercules-ci-effects/flake-modules/herculesCI-attribute.nix

herculesCI.onSchedule.<name>.when

The time at which to schedule a job.

Each subattribute represents an equality, all of which will hold at the next planned time. The time zone is UTC.

The minute or hour attributes can be omitted, in which case Hercules CI will pick an arbitrary time for you.

Type: submodule

Default: { }

Declared by:

hercules-ci-effects/flake-modules/herculesCI-attribute.nix

herculesCI.onSchedule.<name>.when.dayOfMonth

An optional list of day of the month during which to create a job.

The default value null represents all days.

Type: null or ((list of integer between 0 and 31 (both inclusive)) or integer between 0 and 31 (both inclusive) convertible to it)

Default: null

Declared by:

hercules-ci-effects/flake-modules/types/when.nix

herculesCI.onSchedule.<name>.when.dayOfWeek

An optional list of week days during which to create a job.

The default value null represents all days.

Type: null or ((list of (one of "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun")) or (one of "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun") convertible to it)

Default: null

Declared by:

hercules-ci-effects/flake-modules/types/when.nix

herculesCI.onSchedule.<name>.when.hour

An optional integer representing the hours at which a job should be created.

The default value null represents an arbitrary hour.

Type: null or ((list of integer between 0 and 23 (both inclusive)) or integer between 0 and 23 (both inclusive) convertible to it)

Default: null

Declared by:

hercules-ci-effects/flake-modules/types/when.nix

herculesCI.onSchedule.<name>.when.minute

An optional integer representing the minute mark at which a job should be created.

The default value null represents an arbitrary minute.

Type: null or integer between 0 and 59 (both inclusive)

Default: null

Declared by:

hercules-ci-effects/flake-modules/types/when.nix

herculesCI.repo

The repository and checkout metadata of the current checkout, provided by Hercules CI. These options are read-only.

You may read options by querying the config module argument.

Type: submodule (read only)

Declared by:

hercules-ci-effects/flake-modules/herculesCI-attribute.nix

herculesCI.repo.branch

The branch of the checkout. null when not on a branch; e.g. when on a tag.

Type: null or string (read only)

Example: "main"

Declared by:

hercules-ci-effects/flake-modules/herculesCI-attribute.nix

herculesCI.repo.forgeType

What forge implementation hosts the repository.

E.g. "github" or "gitlab"

Since hercules-ci-agent 0.9.8

Type: string (read only)

Default:

Example: "github"

Declared by:

hercules-ci-effects/flake-modules/herculesCI-attribute.nix

herculesCI.repo.name

The name of the repository.

Since hercules-ci-agent 0.9.8

Type: string (read only)

Default:

Declared by:

hercules-ci-effects/flake-modules/herculesCI-attribute.nix

herculesCI.repo.owner

The owner of the repository.

Since hercules-ci-agent 0.9.8

Type: string (read only)

Default:

Declared by:

hercules-ci-effects/flake-modules/herculesCI-attribute.nix

herculesCI.repo.ref

The git "ref" of the checkout.

Type: string (read only)

Example: "refs/heads/main"

Declared by:

hercules-ci-effects/flake-modules/herculesCI-attribute.nix

herculesCI.repo.remoteHttpUrl

HTTP url for cloning the repository.

Since hercules-ci-agent 0.9.8

Type: string (read only)

Default:

Declared by:

hercules-ci-effects/flake-modules/herculesCI-attribute.nix

herculesCI.repo.remoteSshUrl

SSH url for cloning the repository.

Since hercules-ci-agent 0.9.8

Type: string (read only)

Default:

Declared by:

hercules-ci-effects/flake-modules/herculesCI-attribute.nix

herculesCI.repo.rev

The git revision, also known as the commit hash.

Type: string (read only)

Example: "17ae1f614017447a983c34bb046892b3c571df52"

Declared by:

hercules-ci-effects/flake-modules/herculesCI-attribute.nix

herculesCI.repo.shortRev

An abbreviated rev.

Type: string (read only)

Example: "17ae1f6"

Declared by:

hercules-ci-effects/flake-modules/herculesCI-attribute.nix

herculesCI.repo.tag

The tag of the checkout. null when not on a tag; e.g. when on a branch.

Type: null or string (read only)

Example: "1.0"

Declared by:

hercules-ci-effects/flake-modules/herculesCI-attribute.nix

herculesCI.repo.webUrl

A URL to open the repository in the browser.

Since hercules-ci-agent 0.9.8

Type: string (read only)

Default:

Declared by:

hercules-ci-effects/flake-modules/herculesCI-attribute.nix

perSystem

A function from system to flake-like attributes omitting the <system> attribute.

Type: module

Declared by:

hercules-ci-effects/flake-modules/module-argument.nix

perSystem.herculesCIEffects.pkgs

Nixpkgs instance to use for hercules-ci-effects.

The effects functions, etc, will be provided as the effects module argument of perSystem.

Type: raw value

Default: pkgs (module argument)

Declared by:

hercules-ci-effects/flake-modules/module-argument.nix