about summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorWilliButz <WilliButz@users.noreply.github.com>2019-09-14 13:16:07 +0200
committerGitHub <noreply@github.com>2019-09-14 13:16:07 +0200
commitcbb6293dcea87e0537bafe71a264d5f73cc2051c (patch)
treee7f117b42e620089eac6deb3679c4f3d5da4e985 /nixos/modules
parent859dd2199715582515f2ee17e9974ddd7a9d35fc (diff)
parentce37a040c262aed26e9c6fd63ba527ba1bc028cc (diff)
downloadnixlib-cbb6293dcea87e0537bafe71a264d5f73cc2051c.tar
nixlib-cbb6293dcea87e0537bafe71a264d5f73cc2051c.tar.gz
nixlib-cbb6293dcea87e0537bafe71a264d5f73cc2051c.tar.bz2
nixlib-cbb6293dcea87e0537bafe71a264d5f73cc2051c.tar.lz
nixlib-cbb6293dcea87e0537bafe71a264d5f73cc2051c.tar.xz
nixlib-cbb6293dcea87e0537bafe71a264d5f73cc2051c.tar.zst
nixlib-cbb6293dcea87e0537bafe71a264d5f73cc2051c.zip
Merge pull request #68291 from Ma27/bump-hydra
hydra: 2019-05-06 -> 2019-08-30
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/services/continuous-integration/hydra/default.nix20
1 files changed, 20 insertions, 0 deletions
diff --git a/nixos/modules/services/continuous-integration/hydra/default.nix b/nixos/modules/services/continuous-integration/hydra/default.nix
index 500acb485620..2da10a9a5e2a 100644
--- a/nixos/modules/services/continuous-integration/hydra/default.nix
+++ b/nixos/modules/services/continuous-integration/hydra/default.nix
@@ -275,6 +275,7 @@ in
               ${pkgs.sudo}/bin/sudo -u ${config.services.postgresql.superUser} ${config.services.postgresql.package}/bin/createdb -O hydra hydra
               touch ${baseDir}/.db-created
             fi
+            echo "create extension if not exists pg_trgm" | ${pkgs.sudo}/bin/sudo -u ${config.services.postgresql.superUser} -- ${config.services.postgresql.package}/bin/psql hydra
           ''}
 
           if [ ! -e ${cfg.gcRootsDir} ]; then
@@ -379,6 +380,23 @@ in
           };
       };
 
+    systemd.services.hydra-notify =
+      { wantedBy = [ "multi-user.target" ];
+        requires = [ "hydra-init.service" ];
+        after = [ "hydra-init.service" ];
+        restartTriggers = [ hydraConf ];
+        environment = env // {
+          PGPASSFILE = "${baseDir}/pgpass-queue-runner";
+        };
+        serviceConfig =
+          { ExecStart = "@${cfg.package}/bin/hydra-notify hydra-notify";
+            # FIXME: run this under a less privileged user?
+            User = "hydra-queue-runner";
+            Restart = "always";
+            RestartSec = 5;
+          };
+      };
+
     # If there is less than a certain amount of free disk space, stop
     # the queue/evaluator to prevent builds from failing or aborting.
     systemd.services.hydra-check-space =
@@ -416,6 +434,8 @@ in
         hydra-users hydra-queue-runner hydra
         hydra-users hydra-www hydra
         hydra-users root hydra
+        # The postgres user is used to create the pg_trgm extension for the hydra database
+        hydra-users postgres postgres
       '';
 
     services.postgresql.authentication = optionalString haveLocalDB