Add tandoor service.
This commit is contained in:
parent
56d9b357b5
commit
8007a6de7f
3 changed files with 50 additions and 0 deletions
|
@ -34,6 +34,7 @@ in {
|
||||||
services = [
|
services = [
|
||||||
"acme"
|
"acme"
|
||||||
"gitea"
|
"gitea"
|
||||||
|
"tandoor"
|
||||||
# "hydra"
|
# "hydra"
|
||||||
"mailserver"
|
"mailserver"
|
||||||
"mariaDB"
|
"mariaDB"
|
||||||
|
@ -62,6 +63,10 @@ in {
|
||||||
domain = "git.${base}";
|
domain = "git.${base}";
|
||||||
service = "gitea";
|
service = "gitea";
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
domain = "food.${base}";
|
||||||
|
service = "tandoor";
|
||||||
|
}
|
||||||
];
|
];
|
||||||
firewall = {
|
firewall = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
29
services/nginx_vHosts/tandoor.nix
Normal file
29
services/nginx_vHosts/tandoor.nix
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
tandoor = config.services.tandoor-recipes;
|
||||||
|
in {
|
||||||
|
vHost =
|
||||||
|
if tandoor.enable
|
||||||
|
then {
|
||||||
|
extraConfig = ''
|
||||||
|
location /media/ {
|
||||||
|
alias ${tandoor.extraConfig.MEDIA_ROOT};
|
||||||
|
}
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://${tandoor.address}:${toString tandoor.port};
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header REMOTE_ADDR $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
else {};
|
||||||
|
}
|
||||||
|
.vHost
|
16
services/tandoor.nix
Normal file
16
services/tandoor.nix
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib;
|
||||||
|
mkIf (elem "tandoor" config.machine.services) {
|
||||||
|
services.tandoor-recipes = {
|
||||||
|
enable = true;
|
||||||
|
extraConfig = {
|
||||||
|
# Set explicitly so it can be referenced by web-server
|
||||||
|
MEDIA_ROOT = "/var/lib/tandoor-recipes/media/";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue