···37373838 haveLocalDB = cfg.dbi == localDB;
39394040- inherit (config.system) stateVersion;
4141-4240 hydra-package =
4341 let
4442 makeWrapperArgs = concatStringsSep " " (mapAttrsToList (key: value: "--set \"${key}\" \"${value}\"") hydraEnv);
···96949795 package = mkOption {
9896 type = types.package;
9999- defaultText = "pkgs.hydra";
9797+ default = pkgs.hydra-unstable;
9898+ defaultText = "pkgs.hydra-unstable";
10099 description = "The Hydra package.";
101100 };
102101···224223 ###### implementation
225224226225 config = mkIf cfg.enable {
227227-228228- warnings = optional (cfg.package.migration or false) ''
229229- You're currently deploying an older version of Hydra which is needed to
230230- make some required database changes[1]. As soon as this is done, it's recommended
231231- to run `hydra-backfill-ids` and set `services.hydra.package` to `pkgs.hydra-unstable`
232232- after that.
233233-234234- [1] https://github.com/NixOS/hydra/pull/711
235235- '';
236236-237237- services.hydra.package = with pkgs;
238238- mkDefault (
239239- if pkgs ? hydra
240240- then throw ''
241241- The Hydra package doesn't exist anymore in `nixpkgs`! It probably exists
242242- due to an overlay. To upgrade Hydra, you need to take two steps as some
243243- bigger changes in the database schema were implemented recently[1]. You first
244244- need to deploy `pkgs.hydra-migration`, run `hydra-backfill-ids` on the server
245245- and then deploy `pkgs.hydra-unstable`.
246246-247247- If you want to use `pkgs.hydra` from your overlay, please set `services.hydra.package`
248248- explicitly to `pkgs.hydra` and make sure you know what you're doing.
249249-250250- [1] https://github.com/NixOS/hydra/pull/711
251251- ''
252252- else if versionOlder stateVersion "20.03" then hydra-migration
253253- else hydra-unstable
254254- );
255226256227 users.groups.hydra = {
257228 gid = config.ids.gids.hydra;