puter/hosts/abacus/atuin.nix

34 lines
672 B
Nix
Raw Normal View History

2024-03-08 21:46:46 +00:00
{
config,
lib,
...
}: {
services = {
postgresql = {
enable = lib.mkDefault true;
ensureDatabases = ["atuin"];
ensureUsers = [
{
name = "atuin";
ensureDBOwnership = true;
}
];
};
atuin = {
enable = true;
openRegistration = false;
database.uri = "postgresql:///atuin?host=/run/postgresql&user=atuin";
};
nginx.virtualHosts."atuin.${config.networking.domain}" = {
enableACME = true;
forceSSL = true;
quic = true;
locations."/".proxyPass = "http://${config.services.atuin.host}:${builtins.toString config.services.atuin.port}";
};
};
}