nixos: services: tandoor-recipes: use automatic DB
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
8d809e3ac3
commit
b093faf00d
1 changed files with 4 additions and 21 deletions
|
|
@ -26,18 +26,16 @@ in
|
||||||
services.tandoor-recipes = {
|
services.tandoor-recipes = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
database = {
|
||||||
|
createLocally = true;
|
||||||
|
};
|
||||||
|
|
||||||
port = cfg.port;
|
port = cfg.port;
|
||||||
extraConfig =
|
extraConfig =
|
||||||
let
|
let
|
||||||
tandoorRecipesDomain = "recipes.${config.networking.domain}";
|
tandoorRecipesDomain = "recipes.${config.networking.domain}";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
# Use PostgreSQL
|
|
||||||
DB_ENGINE = "django.db.backends.postgresql";
|
|
||||||
POSTGRES_HOST = "/run/postgresql";
|
|
||||||
POSTGRES_USER = "tandoor_recipes";
|
|
||||||
POSTGRES_DB = "tandoor_recipes";
|
|
||||||
|
|
||||||
# Security settings
|
# Security settings
|
||||||
ALLOWED_HOSTS = tandoorRecipesDomain;
|
ALLOWED_HOSTS = tandoorRecipesDomain;
|
||||||
CSRF_TRUSTED_ORIGINS = "https://${tandoorRecipesDomain}";
|
CSRF_TRUSTED_ORIGINS = "https://${tandoorRecipesDomain}";
|
||||||
|
|
@ -49,27 +47,12 @@ in
|
||||||
|
|
||||||
systemd.services = {
|
systemd.services = {
|
||||||
tandoor-recipes = {
|
tandoor-recipes = {
|
||||||
after = [ "postgresql.target" ];
|
|
||||||
requires = [ "postgresql.target" ];
|
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
EnvironmentFile = cfg.secretKeyFile;
|
EnvironmentFile = cfg.secretKeyFile;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Set-up database
|
|
||||||
services.postgresql = {
|
|
||||||
enable = true;
|
|
||||||
ensureDatabases = [ "tandoor_recipes" ];
|
|
||||||
ensureUsers = [
|
|
||||||
{
|
|
||||||
name = "tandoor_recipes";
|
|
||||||
ensureDBOwnership = true;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
my.services.nginx.virtualHosts = {
|
my.services.nginx.virtualHosts = {
|
||||||
recipes = {
|
recipes = {
|
||||||
inherit (cfg) port;
|
inherit (cfg) port;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue