more jellyfin + nextcloud tweaking, microbin live
This commit is contained in:
@@ -4,6 +4,31 @@ let
|
||||
enable = true;
|
||||
group = "piracy";
|
||||
};
|
||||
proxy = locations: {
|
||||
inherit locations;
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
http2 = true;
|
||||
};
|
||||
proxyReverse = port:
|
||||
proxy {
|
||||
"/".proxyPass =
|
||||
"http://${config.my.servers.settings.localhost}:${toString port}/";
|
||||
};
|
||||
proxyReverseArr = port:
|
||||
proxy port // {
|
||||
extraConfig = ''
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Host $host;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $http_connection;
|
||||
|
||||
proxy_redirect off;
|
||||
proxy_http_version 1.1;
|
||||
'';
|
||||
};
|
||||
enableDocker = lib.any (opt: opt) [
|
||||
config.my.servers.collabora.enable
|
||||
config.my.servers.go-vod.enable
|
||||
@@ -12,11 +37,24 @@ in {
|
||||
imports = [
|
||||
(import ./servers/jellyfin.nix { inherit lib config pkgs serviceBase; })
|
||||
(import ./servers/nextcloud.nix { inherit lib config pkgs serviceBase; })
|
||||
(import ./servers/microbin.nix { inherit lib config proxyReverse; })
|
||||
];
|
||||
options.my.servers.settings = {
|
||||
localhost = "127.0.0.1";
|
||||
domain = "servidos.lat";
|
||||
postgresSocket = "/run/postgresql";
|
||||
localhost = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "127.0.0.1";
|
||||
description = "The localhost address.";
|
||||
};
|
||||
domain = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "servidos.lat";
|
||||
description = "The domain name.";
|
||||
};
|
||||
postgresSocket = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "/run/postgresql";
|
||||
description = "The PostgreSQL socket path.";
|
||||
};
|
||||
};
|
||||
config = {
|
||||
my.servers = {
|
||||
@@ -30,17 +68,15 @@ in {
|
||||
};
|
||||
collabora.enable = lib.mkDefault false;
|
||||
go-vod.enable = lib.mkDefault false;
|
||||
microbin.enable = lib.mkDefault false;
|
||||
};
|
||||
virtualisation = lib.mkIf enableDocker {
|
||||
oci-containers.backend = "docker";
|
||||
docker = {
|
||||
virtualisation.docker = lib.mkIf enableDocker {
|
||||
enable = true;
|
||||
enableNvidia = true;
|
||||
autoPrune = {
|
||||
enable = true;
|
||||
enableNvidia = true;
|
||||
autoPrune = {
|
||||
enable = true;
|
||||
flags = [ "--all" ];
|
||||
dates = "weekly";
|
||||
};
|
||||
flags = [ "--all" ];
|
||||
dates = "weekly";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user