Basic workarounds to allow remote Hydra DBs

User creation isn't supported here, see #3 for further reference.
parent 1d417ce7
......@@ -16,6 +16,8 @@ let
vhostCfg = cfg.vhost;
haveLocalDB = config.services.hydra.dbi == "dbi:Pg:dbname=hydra;user=hydra;";
userScript = with builtins; concatStringsSep "\n" (flip mapAttrsToList cfg.users (name: cfg: ''
set -e
# creating ${name} if not exists
......@@ -200,6 +202,13 @@ in
config = mkIf cfg.enable {
assertions = [
{
assertion = cfg.users != {} -> haveLocalDB;
message = "Cannot generate users without local db (not implemented yet, see #3)";
}
];
services.hydra.enable = true;
services.hydra.hydraURL = vhostCfg.name;
services.hydra.notificationSender = emailCfg.sender;
......@@ -222,8 +231,6 @@ in
''}
'';
services.postgresql.enable = true;
services.postfix = mkIf emailCfg.enablePostfix {
enable = true;
setSendmail = true;
......@@ -245,7 +252,7 @@ in
enableACME = vhostCfg.enableSSL;
};
systemd.services.hydra-create-users = {
systemd.services.hydra-create-users = mkIf haveLocalDB {
inherit (hydra) environment;
wantedBy = [ "multi-user.target" ];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment