Compare commits

...

2 commits

Author SHA1 Message Date
b093faf00d nixos: services: tandoor-recipes: use automatic DB
All checks were successful
ci/woodpecker/push/check Pipeline was successful
2025-07-08 10:42:13 +00:00
8d809e3ac3 flake: bump inputs 2025-07-08 10:40:08 +00:00
2 changed files with 7 additions and 24 deletions

6
flake.lock generated
View file

@ -175,11 +175,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1751271578,
"narHash": "sha256-P/SQmKDu06x8yv7i0s8bvnnuJYkxVGBWLWHaU+tt4YY=",
"lastModified": 1751952840,
"narHash": "sha256-SIkjQb9PPGvR/EcZAU8UZEnO9dwY2Z/BrDWgtyZd7OA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3016b4b15d13f3089db8a41ef937b13a9e33a8df",
"rev": "27278798fe68d7f81131dd7ab62b8ea2b795cd56",
"type": "github"
},
"original": {

View file

@ -26,18 +26,16 @@ in
services.tandoor-recipes = {
enable = true;
database = {
createLocally = true;
};
port = cfg.port;
extraConfig =
let
tandoorRecipesDomain = "recipes.${config.networking.domain}";
in
{
# Use PostgreSQL
DB_ENGINE = "django.db.backends.postgresql";
POSTGRES_HOST = "/run/postgresql";
POSTGRES_USER = "tandoor_recipes";
POSTGRES_DB = "tandoor_recipes";
# Security settings
ALLOWED_HOSTS = tandoorRecipesDomain;
CSRF_TRUSTED_ORIGINS = "https://${tandoorRecipesDomain}";
@ -49,27 +47,12 @@ in
systemd.services = {
tandoor-recipes = {
after = [ "postgresql.target" ];
requires = [ "postgresql.target" ];
serviceConfig = {
EnvironmentFile = cfg.secretKeyFile;
};
};
};
# Set-up database
services.postgresql = {
enable = true;
ensureDatabases = [ "tandoor_recipes" ];
ensureUsers = [
{
name = "tandoor_recipes";
ensureDBOwnership = true;
}
];
};
my.services.nginx.virtualHosts = {
recipes = {
inherit (cfg) port;