···11/*
2233-This file is for options that NixOS and nix-darwin have in common.
33+ This file is for options that NixOS and nix-darwin have in common.
4455-Platform-specific code is in the respective default.nix files.
55+ Platform-specific code is in the respective default.nix files.
6677- */
77+*/
8899{ config, lib, options, pkgs, ... }:
1010let
···2727 settingsModule = { config, ... }: {
2828 freeformType = format.type;
2929 options = {
3030+ apiBaseUrl = mkOption {
3131+ description = ''
3232+ API base URL that the agent will connect to.
3333+3434+ When using Hercules CI Enterprise, set this to the URL where your
3535+ Hercules CI server is reachable.
3636+ '';
3737+ type = types.str;
3838+ default = "https://hercules-ci.com";
3939+ };
3040 baseDirectory = mkOption {
3141 type = types.path;
3242 default = "/var/lib/hercules-ci-agent";
···5565 type = types.either types.ints.positive (types.enum [ "auto" ]);
5666 default = "auto";
5767 };
6868+ labels = mkOption {
6969+ description = ''
7070+ A key-value map of user data.
7171+7272+ This data will be available to organization members in the dashboard and API.
7373+7474+ The values can be of any TOML type that corresponds to a JSON type, but arrays
7575+ can not contain tables/objects due to limitations of the TOML library. Values
7676+ involving arrays of non-primitive types may not be representable currently.
7777+ '';
7878+ type = format.type;
7979+ defaultText = literalExpression ''
8080+ {
8181+ agent.source = "..."; # One of "nixpkgs", "flake", "override"
8282+ lib.version = "...";
8383+ pkgs.version = "...";
8484+ }
8585+ '';
8686+ };
5887 workDirectory = mkOption {
5988 description = ''
6089 The directory in which temporary subdirectories are created for task state. This includes sources for Nix evaluation.
···6695 staticSecretsDirectory = mkOption {
6796 description = ''
6897 This is the default directory to look for statically configured secrets like <literal>cluster-join-token.key</literal>.
9898+9999+ See also <literal>clusterJoinTokenPath</literal> and <literal>binaryCachesPath</literal> for fine-grained configuration.
69100 '';
70101 type = types.path;
71102 default = config.baseDirectory + "/secrets";
···74105 clusterJoinTokenPath = mkOption {
75106 description = ''
76107 Location of the cluster-join-token.key file.
108108+109109+ You can retrieve the contents of the file when creating a new agent via
110110+ <link xlink:href="https://hercules-ci.com/dashboard">https://hercules-ci.com/dashboard</link>.
111111+112112+ As this value is confidential, it should not be in the store, but
113113+ installed using other means, such as agenix, NixOps
114114+ <literal>deployment.keys</literal>, or manual installation.
115115+116116+ The contents of the file are used for authentication between the agent and the API.
77117 '';
78118 type = types.path;
79119 default = config.staticSecretsDirectory + "/cluster-join-token.key";
80120 defaultText = literalExpression ''staticSecretsDirectory + "/cluster-join-token.key"'';
8181- # internal: It's a bit too detailed to show by default in the docs,
8282- # but useful to define explicitly to allow reuse by other modules.
8383- internal = true;
84121 };
85122 binaryCachesPath = mkOption {
86123 description = ''
8787- Location of the binary-caches.json file.
124124+ Path to a JSON file containing binary cache secret keys.
125125+126126+ As these values are confidential, they should not be in the store, but
127127+ copied over using other means, such as agenix, NixOps
128128+ <literal>deployment.keys</literal>, or manual installation.
129129+130130+ The format is described on <link xlink:href="https://docs.hercules-ci.com/hercules-ci-agent/binary-caches-json/">https://docs.hercules-ci.com/hercules-ci-agent/binary-caches-json/</link>.
88131 '';
89132 type = types.path;
90133 default = config.staticSecretsDirectory + "/binary-caches.json";
91134 defaultText = literalExpression ''staticSecretsDirectory + "/binary-caches.json"'';
9292- # internal: It's a bit too detailed to show by default in the docs,
9393- # but useful to define explicitly to allow reuse by other modules.
9494- internal = true;
135135+ };
136136+ secretsJsonPath = mkOption {
137137+ description = ''
138138+ Path to a JSON file containing secrets for effects.
139139+140140+ As these values are confidential, they should not be in the store, but
141141+ copied over using other means, such as agenix, NixOps
142142+ <literal>deployment.keys</literal>, or manual installation.
143143+144144+ The format is described on <link xlink:href="https://docs.hercules-ci.com/hercules-ci-agent/secrets-json/">https://docs.hercules-ci.com/hercules-ci-agent/secrets-json/</link>.
145145+146146+ '';
147147+ type = types.path;
148148+ default = config.staticSecretsDirectory + "/secrets.json";
149149+ defaultText = literalExpression ''staticSecretsDirectory + "/secrets.json"'';
95150 };
96151 };
97152 };
···177232178233 These are written as options instead of let binding to allow sharing with
179234 default.nix on both NixOS and nix-darwin.
180180- */
235235+ */
181236 tomlFile = mkOption {
182237 type = types.path;
183238 internal = true;
···11/*
2233-This file is for NixOS-specific options and configs.
33+ This file is for NixOS-specific options and configs.
4455-Code that is shared with nix-darwin goes in common.nix.
55+ Code that is shared with nix-darwin goes in common.nix.
6677- */
77+*/
8899{ pkgs, config, lib, ... }:
1010let