nixos: services: mealie: use automatic DB setup
All checks were successful
ci/woodpecker/push/check Pipeline was successful
All checks were successful
ci/woodpecker/push/check Pipeline was successful
This commit is contained in:
parent
1dc65a37e7
commit
5b545a28f1
1 changed files with 3 additions and 17 deletions
|
|
@ -38,27 +38,13 @@ in
|
||||||
# Make it work with socket auth
|
# Make it work with socket auth
|
||||||
POSTGRES_URL_OVERRIDE = "postgresql://mealie:@/mealie?host=/run/postgresql";
|
POSTGRES_URL_OVERRIDE = "postgresql://mealie:@/mealie?host=/run/postgresql";
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services = {
|
# Automatic PostgreSQL provisioning
|
||||||
mealie = {
|
database = {
|
||||||
after = [ "postgresql.service" ];
|
createLocally = true;
|
||||||
requires = [ "postgresql.service" ];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Set-up database
|
|
||||||
services.postgresql = {
|
|
||||||
enable = true;
|
|
||||||
ensureDatabases = [ "mealie" ];
|
|
||||||
ensureUsers = [
|
|
||||||
{
|
|
||||||
name = "mealie";
|
|
||||||
ensureDBOwnership = true;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
my.services.nginx.virtualHosts = {
|
my.services.nginx.virtualHosts = {
|
||||||
mealie = {
|
mealie = {
|
||||||
inherit (cfg) port;
|
inherit (cfg) port;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue