Import or pin hercules-ci-effects
The Nix community does not yet have a standard method for adding dependencies at the Nix level. Flakes are a good candidate, but as of writing, they require the use of unstable versions of Nix, which is not production-ready.
Flakes with overlay
Add to the flake inputs:
hercules-ci-effects.url = "github:hercules-ci/hercules-ci-effects";
In your outputs section, call Nixpkgs with the overlay:
outputs = { nixpkgs, hercules-ci-effects, ... }:
let
system = /* ... */; # or however you bring system into scope
pkgs = import nixpkgs {
overlays = [
hercules-ci-effects
];
};
inherit (pkgs) effects; # optional
in {
# your flake attributes, using `pkgs.effects` or `effects` (optional)
}
Flakes without overlay
Although overlays are a convenient way to make definitions available to all
your expressions, they aren’t necessary for hercules-ci-effects
.
Add the input.
hercules-ci-effects.url = "github:hercules-ci/hercules-ci-effects";
Call hercules-ci-effects
.
outputs = { hercules-ci-effects, ... }:
let
pkgs = /* ... */;
effects = hercules-ci-effects.lib.withPkgs pkgs;
in {
# your flake attributes, using `effects`
}
niv
Niv is a simple tool that maintains references to dependencies in a JSON file and accompanying Nix file.
Add as a source
niv add hercules-ci/hercules-ci-effects
Add
let
inherit (import sources.hercules-ci-effects { inherit pkgs; }) effects;
in
/* ... */
or if you prefer to use the overlay:
let
sources = import ./sources.nix;
pkgs = import sources.nixpkgs {
config = /* ... */;
overlays = [
(import (sources.hercules-ci-effects + "/overlay.nix"))
];
system = /* ... */;
}
in /* use pkgs.effects */
Other methods
Other methods can be used and require expressions similar to those for niv
.
Just replace sources.hercules-ci-effects
by something that returns the
contents of the hercules-ci-effects
repository.