From 5306a9a633f1d8a63c526de6828618cf6156bb33 Mon Sep 17 00:00:00 2001 From: martyTF Date: Wed, 13 May 2026 23:58:57 +0200 Subject: [PATCH 1/7] kavita --- modules/server/media/default.nix | 1 + modules/server/media/kavita.nix | 49 ++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 modules/server/media/kavita.nix diff --git a/modules/server/media/default.nix b/modules/server/media/default.nix index 876a42d..dd099ee 100644 --- a/modules/server/media/default.nix +++ b/modules/server/media/default.nix @@ -8,6 +8,7 @@ { imports = [ ./jellyfin.nix + ./kavita.nix ./navidrome.nix ]; } diff --git a/modules/server/media/kavita.nix b/modules/server/media/kavita.nix new file mode 100644 index 0000000..e31580a --- /dev/null +++ b/modules/server/media/kavita.nix @@ -0,0 +1,49 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + options = { + server.media.kavita = { + enable = lib.mkEnableOption "enable kavita"; + port = lib.mkOption { + default = 3812; + description = "kavita port"; + }; + public = lib.mkEnableOption "make kavita public"; + subdomain = lib.mkOption { + default = "books"; + description = "kavita subdomain"; + }; + }; + }; + config = { + services = { + kavita = { + enable = config.server.media.kavita.enable; + user = config.user.userName; + settings = { + Port = config.server.media.kavita.port; + }; + }; + nginx = { + virtualHosts = { + "${config.server.media.kavita.subdomain}.${config.networking.domain}" = + if config.server.media.kavita.public then + { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://127.0.0.1:${toString config.server.media.kavita.port}"; + }; + } + else + { }; + }; + }; + }; + }; +} From 634171e91d68cff2bbe3b1ce99ff7a2337c802bf Mon Sep 17 00:00:00 2001 From: martyTF Date: Thu, 14 May 2026 00:09:24 +0200 Subject: [PATCH 2/7] moving server from old config to new one (finally) --- modules/device/server.nix | 63 ++++++++++++++++++++++++++++++- modules/server/media/jellyfin.nix | 4 +- modules/server/misc/lauti.nix | 10 ++--- 3 files changed, 68 insertions(+), 9 deletions(-) diff --git a/modules/device/server.nix b/modules/device/server.nix index 2085aba..1908981 100644 --- a/modules/device/server.nix +++ b/modules/device/server.nix @@ -6,5 +6,66 @@ }: { - config = { }; + config = { + server = { + arr = { + enable = true; + }; + cloud = { + immich = { + enable = true; + public = true; + }; + nextcloud = { + enable = true; + public = true; + }; + }; + media = { + jellyfin = { + enable = true; + public = false; + }; + jellyseer = { + enable = true; + public = false; + }; + kavita = { + enable = true; + public = false; + }; + navidrome = { + enable = true; + public = false; + }; + }; + misc = { + dawarich = { + enable = true; + public = false; + }; + forgejo = { + enable = true; + public = true; + }; + lauti = { + enable = true; + public = true; + }; + vaultwarden = { + enable = true; + public = true; + }; + }; + social = { + gotosocial = { + enable = true; + public = true; + }; + synapse = { + enable = true; + }; + }; + }; + }; } diff --git a/modules/server/media/jellyfin.nix b/modules/server/media/jellyfin.nix index 67c4eab..a9e5b23 100644 --- a/modules/server/media/jellyfin.nix +++ b/modules/server/media/jellyfin.nix @@ -6,9 +6,9 @@ }: { - options.server = { + options.server.media = { jellyfin = { - enable = lib.mkEnableOption "enable jelyfin"; + enable = lib.mkEnableOption "enable jellyfin"; port = lib.mkOption { default = 8096; description = "set jellyfin port"; diff --git a/modules/server/misc/lauti.nix b/modules/server/misc/lauti.nix index 8606f0a..5ba0bd5 100644 --- a/modules/server/misc/lauti.nix +++ b/modules/server/misc/lauti.nix @@ -4,9 +4,7 @@ pkgs, ... }: -let - domain = "${config.server.misc.lauti.subdomain}.${config.networking.domain}"; -in + { options = { server.misc.lauti = { @@ -17,7 +15,7 @@ in }; public = lib.mkEnableOption "make lauti public"; domain = lib.mkOption { - default = ""; + default = "calendar"; description = "lauti domain"; }; subdomain = lib.mkOption { @@ -32,7 +30,7 @@ in enable = config.server.misc.lauti.enable; settings = { LAUTI_ADMIN_EMAIL = "lauti@${config.networking.domain}"; - LAUTI_BASE_URL = "https://${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"; @@ -42,7 +40,7 @@ in }; nginx = { virtualHosts = { - "${domain}" = + "${config.server.misc.lauti.subdomain}.${config.networking.domain}" = if config.server.misc.lauti.public then { enableACME = true; From 351f9116741bc747f356437292ee8c484a7f1898 Mon Sep 17 00:00:00 2001 From: martyTF Date: Thu, 14 May 2026 00:10:48 +0200 Subject: [PATCH 3/7] fix --- modules/server/social/synapse.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/server/social/synapse.nix b/modules/server/social/synapse.nix index e734ae1..928e968 100644 --- a/modules/server/social/synapse.nix +++ b/modules/server/social/synapse.nix @@ -19,7 +19,7 @@ in { options = { - server.synapse = { + server.social.synapse = { enable = lib.mkEnableOption "enable synapse"; subdomain = lib.mkOption { default = "yap"; From 97dd1f7d40cb1c346254d126016780b747adcefc Mon Sep 17 00:00:00 2001 From: martyTF Date: Thu, 14 May 2026 00:11:47 +0200 Subject: [PATCH 4/7] fix 2 --- modules/server/social/synapse.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/server/social/synapse.nix b/modules/server/social/synapse.nix index 928e968..8b073fe 100644 --- a/modules/server/social/synapse.nix +++ b/modules/server/social/synapse.nix @@ -68,7 +68,7 @@ in }; listeners = [ { - port = config.server.synapse.port; + port = config.server.social.synapse.port; bind_addresses = [ "127.0.0.1" ]; type = "http"; tls = false; @@ -94,12 +94,12 @@ in locations."= /.well-known/matrix/server".extraConfig = mkWellKnown serverConfig; locations."= /.well-known/matrix/client".extraConfig = mkWellKnown clientConfig; }; - "${config.server.synapse.subdomain}.${config.networking.domain}" = { + "${config.server.social.synapse.subdomain}.${config.networking.domain}" = { enableACME = true; forceSSL = true; locations = { "~ ^(/_matrix|/_synapse/client|/)" = { - proxyPass = "http://127.0.0.1:${toString config.server.synapse.port}"; + proxyPass = "http://127.0.0.1:${toString config.server.social.synapse.port}"; proxyWebsockets = true; extraConfig = "proxy_set_header X-Forwarded-For $remote_addr;" From 2a301ca65d0af60ebd6219da387a133c46ebcb45 Mon Sep 17 00:00:00 2001 From: martyTF Date: Thu, 14 May 2026 00:12:39 +0200 Subject: [PATCH 5/7] argh --- modules/server/social/synapse.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/server/social/synapse.nix b/modules/server/social/synapse.nix index 8b073fe..aba373b 100644 --- a/modules/server/social/synapse.nix +++ b/modules/server/social/synapse.nix @@ -33,7 +33,7 @@ in }; config = { services = - if config.server.synapse.enable then + if config.server.social.synapse.enable then { postgresql.enable = true; matrix-synapse = { From 67cc651c47e2ce3fe5f3b19c193ef5fd0bff2f9d Mon Sep 17 00:00:00 2001 From: martyTF Date: Thu, 14 May 2026 00:13:47 +0200 Subject: [PATCH 6/7] fix 4 --- hosts/marty-server/options.nix | 5 ----- 1 file changed, 5 deletions(-) diff --git a/hosts/marty-server/options.nix b/hosts/marty-server/options.nix index 75cbc6c..f572036 100644 --- a/hosts/marty-server/options.nix +++ b/hosts/marty-server/options.nix @@ -152,10 +152,5 @@ }; }; }; - server = { - synapse = { - subdomain = "yap"; - }; - }; }; } From de6e422647e720de4a38c35f9ae8ca067562c37f Mon Sep 17 00:00:00 2001 From: martyTF Date: Thu, 14 May 2026 00:15:19 +0200 Subject: [PATCH 7/7] h --- modules/server/media/jellyfin.nix | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/server/media/jellyfin.nix b/modules/server/media/jellyfin.nix index a9e5b23..58a58c2 100644 --- a/modules/server/media/jellyfin.nix +++ b/modules/server/media/jellyfin.nix @@ -36,7 +36,7 @@ environment.systemPackages = [ ] ++ ( - if config.server.jellyfin.enable then + if config.server.media.jellyfin.enable then [ pkgs.jellyfin pkgs.jellyfin-web @@ -46,30 +46,30 @@ [ ] ); services = { - jellyfin = lib.mkIf config.server.jellyfin.enable { + jellyfin = lib.mkIf config.server.media.jellyfin.enable { enable = true; }; - seerr = lib.mkIf config.server.jellyseer.enable { + seerr = lib.mkIf config.server.media.jellyseer.enable { enable = true; }; nginx.virtualHosts = { - "${config.server.jellyfin.subdomain}.${config.networking.domain}" = - lib.mkIf config.server.jellyfin.public + "${config.server.media.jellyfin.subdomain}.${config.networking.domain}" = + lib.mkIf config.server.media.jellyfin.public { enableACME = true; forceSSL = true; locations."/" = { - proxyPass = "http://127.0.0.1:${config.server.jellyfin.port}"; + proxyPass = "http://127.0.0.1:${config.server.media.jellyfin.port}"; }; }; - "${config.server.jellyseer.subdomain}.${config.networking.domain}" = - lib.mkIf config.server.jellyfin.public + "${config.server.media.jellyseer.subdomain}.${config.networking.domain}" = + lib.mkIf config.server.media.jellyseer.public { enableACME = true; forceSSL = true; locations."/" = { - proxyPass = "http://127.0.0.1:${config.server.jellyseer.port}"; + proxyPass = "http://127.0.0.1:${config.server.media.jellyseer.port}"; }; }; };