mirror of
https://codeberg.org/muon/home.git
synced 2025-12-06 08:07:45 +00:00
Change host
searx vhost still not working
This commit is contained in:
parent
784c5dfdad
commit
4b3808c042
6 changed files with 71 additions and 53 deletions
|
|
@ -19,8 +19,7 @@ in {
|
||||||
mods.theme.enable = true;
|
mods.theme.enable = true;
|
||||||
mods.theme.scheme = "woodland";
|
mods.theme.scheme = "woodland";
|
||||||
|
|
||||||
mods.server.media.enable = true;
|
mods.server.photos.enable = true;
|
||||||
|
|
||||||
mods.server.search.enable = true;
|
mods.server.search.enable = true;
|
||||||
|
|
||||||
mods.tailscale.enable = true;
|
mods.tailscale.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -33,11 +33,8 @@ in {
|
||||||
mods.server.sync.address = "100.85.27.29";
|
mods.server.sync.address = "100.85.27.29";
|
||||||
mods.server.sync.port = "8385";
|
mods.server.sync.port = "8385";
|
||||||
|
|
||||||
mods.server.media.enable = false;
|
|
||||||
mods.server.photoprism.enable = false;
|
|
||||||
|
|
||||||
mods.server.wireguard.enable = true;
|
|
||||||
mods.server.headscale.enable = false;
|
mods.server.headscale.enable = false;
|
||||||
|
mods.server.wireguard.enable = true;
|
||||||
mods.server.nginx.enable = true;
|
mods.server.nginx.enable = true;
|
||||||
|
|
||||||
# Use the GRUB 2 boot loader.
|
# Use the GRUB 2 boot loader.
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,8 @@ in with lib; {
|
||||||
|
|
||||||
# udev 250 doesn't reliably reinitialize devices after restart
|
# udev 250 doesn't reliably reinitialize devices after restart
|
||||||
systemd.services.systemd-udevd.restartIfChanged = false;
|
systemd.services.systemd-udevd.restartIfChanged = false;
|
||||||
systemd.services.NetworkManager-wait-online.enable = lib.mkForce false;
|
# systemd.services.NetworkManager-wait-online.enable = lib.mkForce false;
|
||||||
systemd.services.systemd-networkd-wait-online.enable = lib.mkForce false;
|
# systemd.services.systemd-networkd-wait-online.enable = lib.mkForce false;
|
||||||
|
|
||||||
services.tailscale.enable = cfg.tailscale.enable;
|
services.tailscale.enable = cfg.tailscale.enable;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,27 +1,50 @@
|
||||||
{ pkgs, lib, config, ... }: {
|
{ pkgs, lib, config, ... }:
|
||||||
options.mods.server.media = {
|
let
|
||||||
enable = lib.mkEnableOption {
|
cfg = config.mods.server;
|
||||||
|
port = 2283;
|
||||||
|
in with lib; {
|
||||||
|
options.mods.server = {
|
||||||
|
videos = {
|
||||||
|
enable = mkEnableOption {
|
||||||
default = false;
|
default = false;
|
||||||
description = "enables media related servers";
|
description = "enables jellyfin server";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf config.mods.server.media.enable {
|
photos = {
|
||||||
services.jellyfin = {
|
enable = mkEnableOption {
|
||||||
|
default = false;
|
||||||
|
description = "enables immich server";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
services.jellyfin = mkIf cfg.videos.enable {
|
||||||
enable = true;
|
enable = true;
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
user = "${config.mods.user.name}";
|
user = "${config.mods.user.name}";
|
||||||
};
|
};
|
||||||
|
|
||||||
services.immich = {
|
# mods.server.nginx.ports.photos = port;
|
||||||
|
services.nginx.virtualHosts."photos.muon.host" = {
|
||||||
|
enableACME = true;
|
||||||
|
forceSSL = true;
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://10.0.0.3:${toString port}";
|
||||||
|
proxyWebsockets = true; # needed if you need to use WebSocket
|
||||||
|
extraConfig =
|
||||||
|
# required when the server wants to use HTTP Authentication
|
||||||
|
"proxy_pass_header Authorization;";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
services.immich = mkIf cfg.photos.enable {
|
||||||
enable = true;
|
enable = true;
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
host = "0.0.0.0";
|
host = "0.0.0.0";
|
||||||
# user = "${config.mods.user.name}";
|
port = port;
|
||||||
};
|
};
|
||||||
|
users.users.immich =
|
||||||
users.users.immich.extraGroups = [ "video" "render" ];
|
mkIf cfg.photos.enable { extraGroups = [ "video" "render" ]; };
|
||||||
|
|
||||||
mods.server.nginx.hosts."photos" = 2283;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ in with lib; {
|
||||||
default = "muon.host";
|
default = "muon.host";
|
||||||
};
|
};
|
||||||
|
|
||||||
hosts = mkOption {
|
ports = mkOption {
|
||||||
type = types.attrsOf (types.ints.u16);
|
type = types.attrsOf (types.ints.u16);
|
||||||
default = { };
|
default = { };
|
||||||
};
|
};
|
||||||
|
|
@ -71,21 +71,18 @@ in with lib; {
|
||||||
proxy_pass_header Authorization;
|
proxy_pass_header Authorization;
|
||||||
'';
|
'';
|
||||||
|
|
||||||
virtualHosts = let
|
# virtualHosts = let
|
||||||
base = locations: {
|
# base = locations: {
|
||||||
inherit locations;
|
# inherit locations;
|
||||||
|
|
||||||
forceSSL = true;
|
# forceSSL = true;
|
||||||
enableACME = true;
|
# enableACME = true;
|
||||||
};
|
# };
|
||||||
proxy = port:
|
# proxy = port:
|
||||||
base {
|
# base { "/".proxyPass = "http://${cfg.ip}:${toString port}/"; };
|
||||||
"/".proxyPass = cfg.ip + toString port + "/";
|
# in mapAttrs' (name: port:
|
||||||
default = true;
|
# nameValuePair ("${name}.${cfg.domain}")
|
||||||
};
|
# (proxy port // { default = true; })) cfg.ports;
|
||||||
in mapAttrs'
|
|
||||||
(name: port: nameValuePair ("${name}.${cfg.domain}") (proxy port))
|
|
||||||
cfg.hosts;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,36 +2,39 @@
|
||||||
let
|
let
|
||||||
inherit (lib) types mkOption mkEnableOption;
|
inherit (lib) types mkOption mkEnableOption;
|
||||||
cfg = config.mods.server.search;
|
cfg = config.mods.server.search;
|
||||||
|
port = 8081;
|
||||||
in {
|
in {
|
||||||
options.mods.server.search = {
|
options.mods.server.search = {
|
||||||
enable = mkEnableOption {
|
enable = mkEnableOption {
|
||||||
default = false;
|
default = false;
|
||||||
description = "enables search engine server";
|
description = "enables search engine server";
|
||||||
};
|
};
|
||||||
|
|
||||||
port = mkOption {
|
|
||||||
type = types.port;
|
|
||||||
default = 8081;
|
|
||||||
};
|
|
||||||
|
|
||||||
nginx = mkOption {
|
|
||||||
type = types.nullOr types.str;
|
|
||||||
default = "search";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
# mods.server.nginx.ports.search = port;
|
||||||
|
services.nginx.virtualHosts."search.muon.host" = {
|
||||||
|
enableACME = true;
|
||||||
|
forceSSL = true;
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://10.0.0.3:${toString port}";
|
||||||
|
proxyWebsockets = true; # needed if you need to use WebSocket
|
||||||
|
extraConfig =
|
||||||
|
# required when the server wants to use HTTP Authentication
|
||||||
|
"proxy_pass_header Authorization;";
|
||||||
|
};
|
||||||
|
};
|
||||||
services.searx = lib.mkIf cfg.enable {
|
services.searx = lib.mkIf cfg.enable {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
runInUwsgi = true;
|
# runInUwsgi = true;
|
||||||
uwsgiConfig = {
|
# uwsgiConfig = {
|
||||||
disable-logging = true;
|
# disable-logging = true;
|
||||||
http = ":${toString cfg.port}";
|
# http = ":${toString port}";
|
||||||
};
|
# };
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
server.port = cfg.port;
|
server.port = port;
|
||||||
server.bind_address = "0.0.0.0";
|
server.bind_address = "0.0.0.0";
|
||||||
server.secret_key = "temporary-before-sops";
|
server.secret_key = "temporary-before-sops";
|
||||||
|
|
||||||
|
|
@ -43,6 +46,5 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue