diff options
author | Robert Hensing <robert@roberthensing.nl> | 2021-02-10 09:49:21 +0100 |
---|---|---|
committer | Robert Hensing <robert@roberthensing.nl> | 2021-02-10 09:49:21 +0100 |
commit | fbabab7b169dbe5ae9656b6e681b27d4af70931e (patch) | |
tree | 0933b6c1b3eda6ef7ac87f8ef38376c913e120fa /nixos/modules | |
parent | a1b1e5a26bfaa6c528d50b7b3f43643e79ab38b5 (diff) |
nixos/hercules-ci-agent: Format with nixpkgs-fmt
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/services/continuous-integration/hercules-ci-agent/common.nix | 48 | ||||
-rw-r--r-- | nixos/modules/services/continuous-integration/hercules-ci-agent/default.nix | 6 |
2 files changed, 26 insertions, 28 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 24884655c660f..522d4ddac317a 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 <<EOF - - You are deploying Hercules CI Agent on a system with an incompatible - nix-daemon. Please make sure nix.package is set to a Nix version of at - least 2.3.10 or a master version more recent than Mar 12, 2020. - EOF - exit 1 - fi - ''; - installPhase = "touch $out"; - }; + 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 <<EOF + + You are deploying Hercules CI Agent on a system with an incompatible + nix-daemon. Please make sure nix.package is set to a Nix version of at + least 2.3.10 or a master version more recent than Mar 12, 2020. + EOF + exit 1 + fi + ''; + installPhase = "touch $out"; + }; in { imports = [ - (mkRenamedOptionModule ["services" "hercules-ci-agent" "extraOptions"] ["services" "hercules-ci-agent" "settings"]) - (mkRenamedOptionModule ["services" "hercules-ci-agent" "baseDirectory"] ["services" "hercules-ci-agent" "settings" "baseDirectory"]) - (mkRenamedOptionModule ["services" "hercules-ci-agent" "concurrentTasks"] ["services" "hercules-ci-agent" "settings" "concurrentTasks"]) - (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.") + (mkRenamedOptionModule [ "services" "hercules-ci-agent" "extraOptions" ] [ "services" "hercules-ci-agent" "settings" ]) + (mkRenamedOptionModule [ "services" "hercules-ci-agent" "baseDirectory" ] [ "services" "hercules-ci-agent" "settings" "baseDirectory" ]) + (mkRenamedOptionModule [ "services" "hercules-ci-agent" "concurrentTasks" ] [ "services" "hercules-ci-agent" "settings" "concurrentTasks" ]) + (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.") ]; options.services.hercules-ci-agent = { 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 79d1ce5805457..3ac207d759a9e 100644 --- a/nixos/modules/services/continuous-integration/hercules-ci-agent/default.nix +++ b/nixos/modules/services/continuous-integration/hercules-ci-agent/default.nix @@ -7,9 +7,7 @@ Code that is shared with nix-darwin goes in common.nix. */ { pkgs, config, lib, ... }: - let - inherit (lib) mkIf mkDefault; cfg = config.services.hercules-ci-agent; @@ -21,7 +19,7 @@ in { imports = [ ./common.nix - (lib.mkRenamedOptionModule ["services" "hercules-ci-agent" "user"] ["systemd" "services" "hercules-ci-agent" "serviceConfig" "User"]) + (lib.mkRenamedOptionModule [ "services" "hercules-ci-agent" "user" ] [ "systemd" "services" "hercules-ci-agent" "serviceConfig" "User" ]) ]; config = mkIf cfg.enable { @@ -80,6 +78,6 @@ in isSystemUser = true; }; - users.groups.hercules-ci-agent = {}; + users.groups.hercules-ci-agent = { }; }; } |