Open
Description
quickly restarting setups like this is problematic since it takes an hour for old leases to expire:
infrastructure-libvirtd.nix
let
defaultConfig =
{
deployment.targetEnv = "libvirtd";
deployment.libvirtd.privateIPv4 = "dhcp";
};
in
{
apiServer = defaultConfig;
postgresqlServer = defaultConfig;
}
network.nix
apiServer =
{ config, pkgs, ... }:
systemd.services.postgrest = {
description = "Wraps postgresql database with REST api";
# Start the service after the network is available
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
# The actual command to run
ExecStart = "${postgrest}/bin/postgrest postgres://root@postgresqlServer:5432/postgres \\
--port 3030 \\
--schema public \\
--anonymous root \\
--pool 200";
};
postgresqlServer =
{ config, pkgs ? import <nixpkgs> {}, ... }:
{ ...etc. etc. }
the postgrest service references the old ip address for postgresqlServer, of the previous deploy. attempt at a fix documented here