···116116 defaultText = "generated from `services.atticd.settings`";
117117 };
118118119119+ mode = lib.mkOption {
120120+ description = ''
121121+ Mode in which to run the server.
122122+123123+ 'monolithic' runs all components, and is suitable for single-node deployments.
124124+125125+ 'api-server' runs only the API server, and is suitable for clustering.
126126+127127+ 'garbage-collector' only runs the garbage collector periodically.
128128+129129+ A simple NixOS-based Attic deployment will typically have one 'monolithic' and any number of 'api-server' nodes.
130130+131131+ There are several other supported modes that perform one-off operations, but these are the only ones that make sense to run via the NixOS module.
132132+ '';
133133+ type = lib.types.enum ["monolithic" "api-server" "garbage-collector"];
134134+ default = "monolithic";
135135+ };
136136+119137 # Internal flags
120138 useFlakeCompatOverlay = lib.mkOption {
121139 description = ''
···168186 after = [ "network.target" ]
169187 ++ lib.optionals hasLocalPostgresDB [ "postgresql.service" "nss-lookup.target" ];
170188 serviceConfig = {
171171- ExecStart = "${cfg.package}/bin/atticd -f ${checkedConfigFile}";
189189+ ExecStart = "${cfg.package}/bin/atticd -f ${checkedConfigFile} --mode ${cfg.mode}";
172190 EnvironmentFile = cfg.credentialsFile;
173191 StateDirectory = "atticd"; # for usage with local storage and sqlite
174192 DynamicUser = true;