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HQC
ZVGQP2SXJRSOOGPVODNWYNX6AJMXRTVYAEEC7CBZKLTO4EWTHQWAC
BT6SNXUAM2ZSGD7DAHJWZJVCWKLLAKAGFHDFCUKMIFG2AG3D65DQC
4J33F22TRXXW3WRI3KAF7DQZXQ7JH3A5XBNR7BJCKK7OFUF4AHSQC
KMPLMG7TDEVQVZGRXQKG66G6P7LUDELSKRFUO557PQ4WZQI3SBAQC
T4DBPQOFUCCD2GLSIT56KSMA2LU3YXDSCT6M5RAJSPQU4TWZJGPAC
3FTM52B2FQBNZ4GANKVIFALA757VXJEP3K4QLVJYQSDWIK7IP5VAC
F3M47DHJB7JTFNWXQ3M3K5ZTNBLWC7GIFL7PWHGJQ6AEPUQ3MBYQC
J57PR4O364QONYJC6ANAA3IY33NUXWBZ5ARYT6XJZXWEHMRXB4GQC
BBF7ZJWHIE5UPMF6RVJE5ZWWSXXZZJX2VXMYY3PVB7BKSWT7YBBAC
K5G5GZY7D7KWVR5RAGZFHH3ZPG5OCLZT4HZ6XIJJ7YYVUMC2CTZQC
24BMQDZAWDQ7VNIA7TIROXSOYLOJBNZ2E4264WHWNJAEN6ZB3UOAC
EKHL23VIJ6XB6EPGNVYCP6XED6ILBC7TBPBNN5NV276VZNKL4IFAC
J5UVLXOK6EDIL5I7VKWH4V2QDS4DPD7FHRK6XBWSXFRQS4JKXFZQC
E3M46H7TCAGXRCCHMVC7Y32M4WLXDVVLQE3VLDYX3V2BNTD47L5AC
users.extraUsers.hydra =
{ description = "Hydra";
home = baseDir;
createHome = true;
useDefaultShell = true;
};
mkdir -m 0700 -p ${baseDir}/data
chown hydra ${baseDir}/data
ln -sf ${hydraConf} ${baseDir}/data/hydra.conf
${optionalString (cfg.dbi == "dbi:Pg:dbname=hydra;user=hydra;") ''
mkdir -p ${baseDir}
chown hydra.hydra ${baseDir}
chmod 0750 ${baseDir}
ln -sf ${hydraConf} ${baseDir}/hydra.conf
mkdir -m 0700 -p /var/lib/hydra/www
chown hydra-www.hydra /var/lib/hydra/www
mkdir -m 0700 -p /var/lib/hydra/queue-runner
mkdir -m 0750 -p /var/lib/hydra/build-logs
chown hydra-queue-runner.hydra /var/lib/hydra/queue-runner /var/lib/hydra/build-logs
${optionalString haveLocalDB ''
services.cron.systemCronJobs =
let
# If there is less than ... GiB of free disk space, stop the queue
# to prevent builds from failing or aborting.
checkSpace = pkgs.writeScript "hydra-check-space"
# 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 =
{ script =
in
[ "*/5 * * * * root ${checkSpace} &> ${baseDir}/data/checkspace.log"
];
startAt = "*:0/5";
};
services.postgresql.enable = mkIf haveLocalDB true;
services.postgresql.identMap = optionalString haveLocalDB
''
hydra-users hydra hydra
hydra-users hydra-queue-runner hydra
hydra-users hydra-www hydra
hydra-users root hydra
'';
services.postgresql.authentication = optionalString haveLocalDB
''
local hydra all ident map=hydra-users
'';