···77 */
8899{ config, lib, options, pkgs, ... }:
1010-1110let
1211 inherit (lib)
1312 filterAttrs
···2221 cfg =
2322 config.services.hercules-ci-agent;
24232525- format = pkgs.formats.toml {};
2424+ format = pkgs.formats.toml { };
26252726 settingsModule = { config, ... }: {
2827 freeformType = format.type;
···3635 };
3736 concurrentTasks = mkOption {
3837 description = ''
3939- Number of tasks to perform simultaneously, such as evaluations, derivations.
3838+ Number of tasks to perform simultaneously.
3939+4040+ A task is a single derivation build or an evaluation.
4141+ At minimum, you need 2 concurrent tasks for <literal>x86_64-linux</literal>
4242+ in your cluster, to allow for import from derivation.
40434141- You must have a total capacity across agents of at least 2 concurrent tasks on <literal>x86_64-linux</literal>
4242- to allow for import from derivation.
4444+ <literal>concurrentTasks</literal> can be around the CPU core count or lower if memory is
4545+ the bottleneck.
4346 '';
4447 type = types.int;
4548 default = 4;
···8588 };
8689 };
87908888- # TODO (2022) remove
9191+ # TODO (roberth, >=2022) remove
8992 checkNix =
9093 if !cfg.checkNix
9194 then ""
9295 else if lib.versionAtLeast config.nix.package.version "2.3.10"
9396 then ""
9494- else pkgs.stdenv.mkDerivation {
9595- name = "hercules-ci-check-system-nix-src";
9696- inherit (config.nix.package) src patches;
9797- configurePhase = ":";
9898- buildPhase = ''
9999- echo "Checking in-memory pathInfoCache expiry"
100100- if ! grep 'PathInfoCacheValue' src/libstore/store-api.hh >/dev/null; then
101101- cat 1>&2 <<EOF
9797+ else
9898+ pkgs.stdenv.mkDerivation {
9999+ name = "hercules-ci-check-system-nix-src";
100100+ inherit (config.nix.package) src patches;
101101+ configurePhase = ":";
102102+ buildPhase = ''
103103+ echo "Checking in-memory pathInfoCache expiry"
104104+ if ! grep 'PathInfoCacheValue' src/libstore/store-api.hh >/dev/null; then
105105+ cat 1>&2 <<EOF
102106103103- You are deploying Hercules CI Agent on a system with an incompatible
104104- nix-daemon. Please make sure nix.package is set to a Nix version of at
105105- least 2.3.10 or a master version more recent than Mar 12, 2020.
106106- EOF
107107- exit 1
108108- fi
109109- '';
110110- installPhase = "touch $out";
111111- };
107107+ You are deploying Hercules CI Agent on a system with an incompatible
108108+ nix-daemon. Please make sure nix.package is set to a Nix version of at
109109+ least 2.3.10 or a master version more recent than Mar 12, 2020.
110110+ EOF
111111+ exit 1
112112+ fi
113113+ '';
114114+ installPhase = "touch $out";
115115+ };
112116113117in
114118{
115119 imports = [
116116- (mkRenamedOptionModule ["services" "hercules-ci-agent" "extraOptions"] ["services" "hercules-ci-agent" "settings"])
117117- (mkRenamedOptionModule ["services" "hercules-ci-agent" "baseDirectory"] ["services" "hercules-ci-agent" "settings" "baseDirectory"])
118118- (mkRenamedOptionModule ["services" "hercules-ci-agent" "concurrentTasks"] ["services" "hercules-ci-agent" "settings" "concurrentTasks"])
119119- (mkRemovedOptionModule ["services" "hercules-ci-agent" "patchNix"] "Nix versions packaged in this version of Nixpkgs don't need a patched nix-daemon to work correctly in Hercules CI Agent clusters.")
120120+ (mkRenamedOptionModule [ "services" "hercules-ci-agent" "extraOptions" ] [ "services" "hercules-ci-agent" "settings" ])
121121+ (mkRenamedOptionModule [ "services" "hercules-ci-agent" "baseDirectory" ] [ "services" "hercules-ci-agent" "settings" "baseDirectory" ])
122122+ (mkRenamedOptionModule [ "services" "hercules-ci-agent" "concurrentTasks" ] [ "services" "hercules-ci-agent" "settings" "concurrentTasks" ])
123123+ (mkRemovedOptionModule [ "services" "hercules-ci-agent" "patchNix" ] "Nix versions packaged in this version of Nixpkgs don't need a patched nix-daemon to work correctly in Hercules CI Agent clusters.")
120124 ];
121125122126 options.services.hercules-ci-agent = {