A fork of attic a self-hostable Nix Binary Cache server
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #74 from lheckemann/nixos-module-mode

nixos: allow setting mode

authored by

Zhaofeng Li and committed by
GitHub
8c8d9d90 40b869ba

+19 -1
+19 -1
nixos/atticd.nix
··· 116 116 defaultText = "generated from `services.atticd.settings`"; 117 117 }; 118 118 119 + mode = lib.mkOption { 120 + description = '' 121 + Mode in which to run the server. 122 + 123 + 'monolithic' runs all components, and is suitable for single-node deployments. 124 + 125 + 'api-server' runs only the API server, and is suitable for clustering. 126 + 127 + 'garbage-collector' only runs the garbage collector periodically. 128 + 129 + A simple NixOS-based Attic deployment will typically have one 'monolithic' and any number of 'api-server' nodes. 130 + 131 + 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. 132 + ''; 133 + type = lib.types.enum ["monolithic" "api-server" "garbage-collector"]; 134 + default = "monolithic"; 135 + }; 136 + 119 137 # Internal flags 120 138 useFlakeCompatOverlay = lib.mkOption { 121 139 description = '' ··· 168 186 after = [ "network.target" ] 169 187 ++ lib.optionals hasLocalPostgresDB [ "postgresql.service" "nss-lookup.target" ]; 170 188 serviceConfig = { 171 - ExecStart = "${cfg.package}/bin/atticd -f ${checkedConfigFile}"; 189 + ExecStart = "${cfg.package}/bin/atticd -f ${checkedConfigFile} --mode ${cfg.mode}"; 172 190 EnvironmentFile = cfg.credentialsFile; 173 191 StateDirectory = "atticd"; # for usage with local storage and sqlite 174 192 DynamicUser = true;