2021-05-03 20:30:40 +02:00
|
|
|
nglib:
|
|
|
|
let
|
|
|
|
inherit (nglib "x86_64-linux") makeSystem;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
postgresql = makeSystem {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
name = "nixng-hydra-postgresql";
|
|
|
|
config = { pkgs, config, ... }:
|
|
|
|
{
|
|
|
|
config = {
|
|
|
|
dumb-init = {
|
|
|
|
enable = true;
|
|
|
|
type.services = {};
|
|
|
|
};
|
|
|
|
services.postgresql = {
|
|
|
|
enable = true;
|
|
|
|
package = pkgs.postgresql_12;
|
|
|
|
|
|
|
|
initialScript = "/secrets/init.sql";
|
|
|
|
enableTCPIP = true;
|
|
|
|
|
|
|
|
authentication = "host all all all md5";
|
|
|
|
|
|
|
|
ensureDatabases = [ "hydra" ];
|
|
|
|
ensureExtensions = {
|
|
|
|
"pg_trgm" = [ "hydra" ];
|
|
|
|
};
|
|
|
|
ensureUsers = [
|
|
|
|
{ name = "hydra"; ensurePermissions = {
|
|
|
|
"DATABASE \"hydra\"" = "ALL PRIVILEGES";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
hydra = makeSystem {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
name = "nixng-hydra";
|
|
|
|
config = { pkgs, config, ... }:
|
|
|
|
{
|
|
|
|
config = {
|
|
|
|
dumb-init = {
|
|
|
|
enable = true;
|
|
|
|
type.services = {};
|
|
|
|
};
|
|
|
|
nix = {
|
2021-08-15 00:24:08 +02:00
|
|
|
package = pkgs.nixUnstable.override {
|
|
|
|
patches = [ ./0001-Add-ignored_acls-setting.patch ];
|
2021-05-03 20:30:40 +02:00
|
|
|
};
|
|
|
|
loadNixDb = true;
|
|
|
|
overlayNix = "/nix-persist";
|
|
|
|
config = {
|
|
|
|
experimental-features = [ "nix-command" "flakes" ];
|
|
|
|
sandbox = true;
|
|
|
|
trusted-public-keys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" ];
|
|
|
|
substituters = [ "https://cache.nixos.org/" ];
|
|
|
|
ignored-acls = [ "system.nfs4_acl" ];
|
2021-05-12 17:31:15 +02:00
|
|
|
allowed-uris = "https://gitea.redalder.org";
|
2021-05-03 20:30:40 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
services.hydra = {
|
|
|
|
enable = true;
|
|
|
|
hydraURL = "https://hydra.redalder.org";
|
|
|
|
notificationSender = "hydra@redalder.org";
|
|
|
|
useSubstitutes = true;
|
2021-08-16 01:47:01 +02:00
|
|
|
adjustNiceness = true;
|
2021-05-03 20:30:40 +02:00
|
|
|
|
2021-08-15 23:02:52 +02:00
|
|
|
minimumDiskFree = 200;
|
|
|
|
minimumDiskFreeEvaluator = 100;
|
2021-08-15 22:25:49 +02:00
|
|
|
|
2021-05-03 20:30:40 +02:00
|
|
|
dbiFile = "/local/dbi";
|
|
|
|
};
|
|
|
|
services.socklog = {
|
|
|
|
enable = true;
|
|
|
|
unix = "/dev/log";
|
|
|
|
};
|
|
|
|
|
|
|
|
init.services.pgpass = {
|
|
|
|
script = pkgs.writeShellScript "pgpass" ''
|
|
|
|
ln -nsf /secrets/pgpass /var/lib/hydra/pgpass
|
|
|
|
ln -nsf /secrets/pgpass-www /var/lib/hydra/pgpass-www
|
|
|
|
ln -nsf /secrets/pgpass-queue-runner /var/lib/hydra/pgpass-queue-runner
|
|
|
|
|
|
|
|
chown hydra:hydra /secrets/pgpass
|
|
|
|
chown hydra-www:hydra /secrets/pgpass-www
|
|
|
|
chown hydra-queue-runner:hydra /secrets/pgpass-queue-runner
|
|
|
|
sv down pgpass
|
|
|
|
'';
|
|
|
|
enabled = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|