diff options
author | Graham Christensen <graham@grahamc.com> | 2020-03-28 19:18:10 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-28 19:18:10 -0400 |
commit | 4d226bad77f0fb91528426303c8ee2b3b205dc9a (patch) | |
tree | c4d82454ba3c6cba526c42ed6aad6d1a3059290a /nixos/modules | |
parent | 596b601dfa8e8412fbc6db7748f6e4fb359a7731 (diff) | |
parent | bd5324c4fcb990715c64fc40c19341947e04bf17 (diff) | |
download | nixlib-4d226bad77f0fb91528426303c8ee2b3b205dc9a.tar nixlib-4d226bad77f0fb91528426303c8ee2b3b205dc9a.tar.gz nixlib-4d226bad77f0fb91528426303c8ee2b3b205dc9a.tar.bz2 nixlib-4d226bad77f0fb91528426303c8ee2b3b205dc9a.tar.lz nixlib-4d226bad77f0fb91528426303c8ee2b3b205dc9a.tar.xz nixlib-4d226bad77f0fb91528426303c8ee2b3b205dc9a.tar.zst nixlib-4d226bad77f0fb91528426303c8ee2b3b205dc9a.zip |
Merge pull request #83600 from Ma27/hydra-two-stage-deploy
hydra: 2020-02-06 -> 2020-03-{24,27}
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/services/continuous-integration/hydra/default.nix | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/nixos/modules/services/continuous-integration/hydra/default.nix b/nixos/modules/services/continuous-integration/hydra/default.nix index 8b56207590a1..0c335f14f785 100644 --- a/nixos/modules/services/continuous-integration/hydra/default.nix +++ b/nixos/modules/services/continuous-integration/hydra/default.nix @@ -37,6 +37,8 @@ let haveLocalDB = cfg.dbi == localDB; + inherit (config.system) stateVersion; + in { @@ -63,8 +65,7 @@ in }; package = mkOption { - type = types.path; - default = pkgs.hydra; + type = types.package; defaultText = "pkgs.hydra"; description = "The Hydra package."; }; @@ -194,6 +195,34 @@ in config = mkIf cfg.enable { + warnings = optional (cfg.package.migration or false) '' + You're currently deploying an older version of Hydra which is needed to + make some required database changes[1]. As soon as this is done, it's recommended + to run `hydra-backfill-ids` and set `services.hydra.package` to either `pkgs.hydra-unstable` + or `pkgs.hydra-flakes` after that. + + [1] https://github.com/NixOS/hydra/pull/711 + ''; + + services.hydra.package = with pkgs; + mkDefault ( + if pkgs ? hydra + then throw '' + The Hydra package doesn't exist anymore in `nixpkgs`! It probably exists + due to an overlay. To upgrade Hydra, you need to take two steps as some + bigger changes in the database schema were implemented recently[1]. You first + need to deploy `pkgs.hydra-migration`, run `hydra-backfill-ids` on the server + and then deploy either `pkgs.hydra-unstable` or `pkgs.hydra-flakes`. + + If you want to use `pkgs.hydra` from your overlay, please set `services.hydra.package` + explicitly to `pkgs.hydra` and make sure you know what you're doing. + + [1] https://github.com/NixOS/hydra/pull/711 + '' + else if versionOlder stateVersion "20.03" then hydra-migration + else hydra-unstable + ); + users.groups.hydra = { gid = config.ids.gids.hydra; }; |