54 lines
1.5 KiB
Nix
54 lines
1.5 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
|
|
{
|
|
options = {
|
|
server.misc.lauti = {
|
|
enable = lib.mkEnableOption "enable lauti";
|
|
port = lib.mkOption {
|
|
default = 3333;
|
|
description = "lauti port";
|
|
};
|
|
public = lib.mkEnableOption "make lauti public";
|
|
subdomain = lib.mkOption {
|
|
default = "lauti";
|
|
description = "lauti subdomain";
|
|
};
|
|
};
|
|
};
|
|
config = {
|
|
services = {
|
|
lauti = {
|
|
enable = config.server.misc.lauti.enable;
|
|
settings = {
|
|
LAUTI_ADMIN_EMAIL = "lauti@${config.networking.domain}";
|
|
LAUTI_BASE_URL = "https://${config.server.misc.lauti.subdomain}.${config.networking.domain}";
|
|
LAUTI_OSM_TILE_CACHE_DIR = "/var/lib/lauti/osm";
|
|
LAUTI_OSM_TILE_SERVER = "https://tile.openstreetmap.org/{z}/{x}/{y}.png";
|
|
LAUTI_TIMEZONE = "Europe/Berlin";
|
|
LAUTI_LANGUAGE = config.console.keyMap;
|
|
};
|
|
secrets = [ /home/${config.user.userName}/secrets/lauti ];
|
|
};
|
|
nginx = {
|
|
virtualHosts = {
|
|
"${config.server.misc.lauti.subdomain}.${config.networking.domain}" =
|
|
if config.server.misc.lauti.public then
|
|
{
|
|
enableACME = true;
|
|
forceSSL = true;
|
|
locations."/" = {
|
|
proxyPass = "http://127.0.0.1:${toString config.server.misc.lauti.port}";
|
|
};
|
|
}
|
|
else
|
|
{ };
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|