Compare commits
2 commits
66ec807dc6
...
b093faf00d
| Author | SHA1 | Date | |
|---|---|---|---|
| b093faf00d | |||
| 8d809e3ac3 |
2 changed files with 7 additions and 24 deletions
6
flake.lock
generated
6
flake.lock
generated
|
|
@ -175,11 +175,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751271578,
|
"lastModified": 1751952840,
|
||||||
"narHash": "sha256-P/SQmKDu06x8yv7i0s8bvnnuJYkxVGBWLWHaU+tt4YY=",
|
"narHash": "sha256-SIkjQb9PPGvR/EcZAU8UZEnO9dwY2Z/BrDWgtyZd7OA=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "3016b4b15d13f3089db8a41ef937b13a9e33a8df",
|
"rev": "27278798fe68d7f81131dd7ab62b8ea2b795cd56",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
|
|
@ -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