···7 */
89{ config, lib, options, pkgs, ... }:
10-11let
12 inherit (lib)
13 filterAttrs
···22 cfg =
23 config.services.hercules-ci-agent;
2425- format = pkgs.formats.toml {};
2627 settingsModule = { config, ... }: {
28 freeformType = format.type;
···36 };
37 concurrentTasks = mkOption {
38 description = ''
39- Number of tasks to perform simultaneously, such as evaluations, derivations.
00004041- You must have a total capacity across agents of at least 2 concurrent tasks on <literal>x86_64-linux</literal>
42- to allow for import from derivation.
43 '';
44 type = types.int;
45 default = 4;
···85 };
86 };
8788- # TODO (2022) remove
89 checkNix =
90 if !cfg.checkNix
91 then ""
92 else if lib.versionAtLeast config.nix.package.version "2.3.10"
93 then ""
94- else pkgs.stdenv.mkDerivation {
95- name = "hercules-ci-check-system-nix-src";
96- inherit (config.nix.package) src patches;
97- configurePhase = ":";
98- buildPhase = ''
99- echo "Checking in-memory pathInfoCache expiry"
100- if ! grep 'PathInfoCacheValue' src/libstore/store-api.hh >/dev/null; then
101- cat 1>&2 <<EOF
0102103- You are deploying Hercules CI Agent on a system with an incompatible
104- nix-daemon. Please make sure nix.package is set to a Nix version of at
105- least 2.3.10 or a master version more recent than Mar 12, 2020.
106- EOF
107- exit 1
108- fi
109- '';
110- installPhase = "touch $out";
111- };
112113in
114{
115 imports = [
116- (mkRenamedOptionModule ["services" "hercules-ci-agent" "extraOptions"] ["services" "hercules-ci-agent" "settings"])
117- (mkRenamedOptionModule ["services" "hercules-ci-agent" "baseDirectory"] ["services" "hercules-ci-agent" "settings" "baseDirectory"])
118- (mkRenamedOptionModule ["services" "hercules-ci-agent" "concurrentTasks"] ["services" "hercules-ci-agent" "settings" "concurrentTasks"])
119- (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.")
120 ];
121122 options.services.hercules-ci-agent = {
···7 */
89{ config, lib, options, pkgs, ... }:
010let
11 inherit (lib)
12 filterAttrs
···21 cfg =
22 config.services.hercules-ci-agent;
2324+ format = pkgs.formats.toml { };
2526 settingsModule = { config, ... }: {
27 freeformType = format.type;
···35 };
36 concurrentTasks = mkOption {
37 description = ''
38+ Number of tasks to perform simultaneously.
39+40+ A task is a single derivation build or an evaluation.
41+ At minimum, you need 2 concurrent tasks for <literal>x86_64-linux</literal>
42+ in your cluster, to allow for import from derivation.
4344+ <literal>concurrentTasks</literal> can be around the CPU core count or lower if memory is
45+ the bottleneck.
46 '';
47 type = types.int;
48 default = 4;
···88 };
89 };
9091+ # TODO (roberth, >=2022) remove
92 checkNix =
93 if !cfg.checkNix
94 then ""
95 else if lib.versionAtLeast config.nix.package.version "2.3.10"
96 then ""
97+ else
98+ pkgs.stdenv.mkDerivation {
99+ name = "hercules-ci-check-system-nix-src";
100+ inherit (config.nix.package) src patches;
101+ configurePhase = ":";
102+ buildPhase = ''
103+ echo "Checking in-memory pathInfoCache expiry"
104+ if ! grep 'PathInfoCacheValue' src/libstore/store-api.hh >/dev/null; then
105+ cat 1>&2 <<EOF
106107+ You are deploying Hercules CI Agent on a system with an incompatible
108+ nix-daemon. Please make sure nix.package is set to a Nix version of at
109+ least 2.3.10 or a master version more recent than Mar 12, 2020.
110+ EOF
111+ exit 1
112+ fi
113+ '';
114+ installPhase = "touch $out";
115+ };
116117in
118{
119 imports = [
120+ (mkRenamedOptionModule [ "services" "hercules-ci-agent" "extraOptions" ] [ "services" "hercules-ci-agent" "settings" ])
121+ (mkRenamedOptionModule [ "services" "hercules-ci-agent" "baseDirectory" ] [ "services" "hercules-ci-agent" "settings" "baseDirectory" ])
122+ (mkRenamedOptionModule [ "services" "hercules-ci-agent" "concurrentTasks" ] [ "services" "hercules-ci-agent" "settings" "concurrentTasks" ])
123+ (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.")
124 ];
125126 options.services.hercules-ci-agent = {