···3738 haveLocalDB = cfg.dbi == localDB;
3940- inherit (config.system) stateVersion;
41-42 hydra-package =
43 let
44 makeWrapperArgs = concatStringsSep " " (mapAttrsToList (key: value: "--set \"${key}\" \"${value}\"") hydraEnv);
···9697 package = mkOption {
98 type = types.package;
99- defaultText = "pkgs.hydra";
0100 description = "The Hydra package.";
101 };
102···224 ###### implementation
225226 config = mkIf cfg.enable {
227-228- warnings = optional (cfg.package.migration or false) ''
229- You're currently deploying an older version of Hydra which is needed to
230- make some required database changes[1]. As soon as this is done, it's recommended
231- to run `hydra-backfill-ids` and set `services.hydra.package` to `pkgs.hydra-unstable`
232- after that.
233-234- [1] https://github.com/NixOS/hydra/pull/711
235- '';
236-237- services.hydra.package = with pkgs;
238- mkDefault (
239- if pkgs ? hydra
240- then throw ''
241- The Hydra package doesn't exist anymore in `nixpkgs`! It probably exists
242- due to an overlay. To upgrade Hydra, you need to take two steps as some
243- bigger changes in the database schema were implemented recently[1]. You first
244- need to deploy `pkgs.hydra-migration`, run `hydra-backfill-ids` on the server
245- and then deploy `pkgs.hydra-unstable`.
246-247- If you want to use `pkgs.hydra` from your overlay, please set `services.hydra.package`
248- explicitly to `pkgs.hydra` and make sure you know what you're doing.
249-250- [1] https://github.com/NixOS/hydra/pull/711
251- ''
252- else if versionOlder stateVersion "20.03" then hydra-migration
253- else hydra-unstable
254- );
255256 users.groups.hydra = {
257 gid = config.ids.gids.hydra;