From fbabab7b169dbe5ae9656b6e681b27d4af70931e Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 10 Feb 2021 09:49:21 +0100 Subject: [PATCH 1/4] nixos/hercules-ci-agent: Format with nixpkgs-fmt --- .../hercules-ci-agent/common.nix | 46 +++++++++---------- .../hercules-ci-agent/default.nix | 6 +-- 2 files changed, 25 insertions(+), 27 deletions(-) diff --git a/nixos/modules/services/continuous-integration/hercules-ci-agent/common.nix b/nixos/modules/services/continuous-integration/hercules-ci-agent/common.nix index 24884655c660..522d4ddac317 100644 --- a/nixos/modules/services/continuous-integration/hercules-ci-agent/common.nix +++ b/nixos/modules/services/continuous-integration/hercules-ci-agent/common.nix @@ -7,7 +7,6 @@ Platform-specific code is in the respective default.nix files. */ { config, lib, options, pkgs, ... }: - let inherit (lib) filterAttrs @@ -22,7 +21,7 @@ let cfg = config.services.hercules-ci-agent; - format = pkgs.formats.toml {}; + format = pkgs.formats.toml { }; settingsModule = { config, ... }: { freeformType = format.type; @@ -91,32 +90,33 @@ let then "" else if lib.versionAtLeast config.nix.package.version "2.3.10" then "" - else pkgs.stdenv.mkDerivation { - name = "hercules-ci-check-system-nix-src"; - inherit (config.nix.package) src patches; - configurePhase = ":"; - buildPhase = '' - echo "Checking in-memory pathInfoCache expiry" - if ! grep 'PathInfoCacheValue' src/libstore/store-api.hh >/dev/null; then - cat 1>&2 </dev/null; then + cat 1>&2 < Date: Wed, 10 Feb 2021 09:49:57 +0100 Subject: [PATCH 2/4] nixos/hercules-ci-agent: Improve concurrentTasks option doc --- .../hercules-ci-agent/common.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/nixos/modules/services/continuous-integration/hercules-ci-agent/common.nix b/nixos/modules/services/continuous-integration/hercules-ci-agent/common.nix index 522d4ddac317..3df057b10279 100644 --- a/nixos/modules/services/continuous-integration/hercules-ci-agent/common.nix +++ b/nixos/modules/services/continuous-integration/hercules-ci-agent/common.nix @@ -35,10 +35,14 @@ let }; concurrentTasks = mkOption { description = '' - Number of tasks to perform simultaneously, such as evaluations, derivations. + Number of tasks to perform simultaneously. - You must have a total capacity across agents of at least 2 concurrent tasks on x86_64-linux - to allow for import from derivation. + A task is a single derivation build or an evaluation. + At minimum, you need 2 concurrent tasks for x86_64-linux + in your cluster, to allow for import from derivation. + + concurrentTasks can be around the CPU core count or lower if memory is + the bottleneck. ''; type = types.int; default = 4; From 460ba46a4a2d69bebf5ed67ee7ab864b4fa411f2 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 10 Feb 2021 09:50:27 +0100 Subject: [PATCH 3/4] nixos/hercules-ci-agent: Add myself to meta.maintainers --- .../continuous-integration/hercules-ci-agent/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/modules/services/continuous-integration/hercules-ci-agent/default.nix b/nixos/modules/services/continuous-integration/hercules-ci-agent/default.nix index 3ac207d759a9..e8a42e59de0d 100644 --- a/nixos/modules/services/continuous-integration/hercules-ci-agent/default.nix +++ b/nixos/modules/services/continuous-integration/hercules-ci-agent/default.nix @@ -80,4 +80,6 @@ in users.groups.hercules-ci-agent = { }; }; + + meta.maintainers = [ lib.maintainers.roberth ]; } From 696294ea9fdd23278d05d146e52bcfcd9e9723fd Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 10 Feb 2021 10:36:00 +0100 Subject: [PATCH 4/4] Improve todo --- .../continuous-integration/hercules-ci-agent/common.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/continuous-integration/hercules-ci-agent/common.nix b/nixos/modules/services/continuous-integration/hercules-ci-agent/common.nix index 3df057b10279..9f9b86ee61cb 100644 --- a/nixos/modules/services/continuous-integration/hercules-ci-agent/common.nix +++ b/nixos/modules/services/continuous-integration/hercules-ci-agent/common.nix @@ -88,7 +88,7 @@ let }; }; - # TODO (2022) remove + # TODO (roberth, >=2022) remove checkNix = if !cfg.checkNix then ""