server and other shit

This commit is contained in:
martyTF 2026-04-11 17:21:28 +02:00
parent 270e1a0be4
commit 804371bf96
65 changed files with 1428 additions and 619 deletions

View file

@ -0,0 +1,34 @@
{
config,
lib,
pkgs,
...
}:
{
options = {
server.misc.dawarich = {
enable = lib.mkEnableOption "enable dawarich";
port = lib.mkOption {
default = 2975;
description = "dawarich port";
};
public = lib.mkEnableOption "make dawarich public";
subdomain = lib.mkOption {
default = "dawarich";
description = "dawarich subdomain";
};
};
};
config = {
services.dawarich = {
enable = config.server.misc.dawarich.enable;
webPort = config.server.misc.dawarich.port;
localDomain =
if config.server.misc.dawarich.public then
"${config.server.misc.dawarich.subdomain}.${config.networking.domain}"
else
config.networking.hostName;
};
};
}

View file

@ -0,0 +1,14 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [
./dawarich.nix
./forgejo.nix
./lauti.nix
];
}

View file

@ -0,0 +1,72 @@
{
config,
lib,
pkgs,
...
}:
{
options = {
server.misc.forgejo = {
enable = lib.mkEnableOption "enable forgejo";
port = lib.mkOption {
default = 2934;
description = "forgejo port";
};
public = lib.mkEnableOption "public forgejo";
subdomain = lib.mkOption {
default = "git";
description = "forgejo subdomain";
};
settings = {
app_name = lib.mkOption {
default = "${config.user.userName}'s code dump";
description = "forgejo app name";
};
app_slogan = lib.mkOption {
default = "if code could talk, mine would cry";
description = "forgejo app slogan";
};
};
};
};
config = {
services = {
forgejo = {
enable = config.server.misc.forgejo.enable;
database.type = "postgres";
settings = {
server = {
DOMAIN = "${config.server.misc.forgejo.subdomain}.${config.networking.domain}";
ROOT_URL = "https://${config.server.misc.forgejo.subdomain}.${config.networking.domain}";
HTTP_PORT = config.server.misc.forgejo.port;
};
DEFAULT = {
APP_NAME = config.server.misc.forgejo.settings.app_name;
APP_SLOGAN = config.server.misc.forgejo.settings.app_slogan;
};
REPOSITORY = {
ENABLE_PUSH_CREATE_USER = true;
ENABLE_PUSH_CREATE_ORG = true;
};
service.DISABLE_REGISTRATION = true;
};
};
nginx = {
virtualHosts = {
"${config.server.misc.forgejo.subdomain}.${config.networking.domain}" =
if config.server.misc.forgejo.public then
{
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://127.0.0.1:${toString config.server.misc.forgejo.port}";
};
}
else
{ };
};
};
};
};
}

View file

@ -0,0 +1,54 @@
{
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
{ };
};
};
};
};
}