mirror of
https://github.com/tuxdotrs/nix-config.git
synced 2026-09-19 16:49:04 +05:30
refactor(services): standardize service module options
This commit is contained in:
@@ -18,17 +18,17 @@
|
||||
default = 3000;
|
||||
};
|
||||
|
||||
domain = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
};
|
||||
|
||||
dataDir = mkOption {
|
||||
type = types.path;
|
||||
default = "/var/lib/docker/volumes/aiostreams/_data";
|
||||
description = "Directory to store persistent AIOStreams data";
|
||||
};
|
||||
|
||||
environment = mkOption {
|
||||
type = with types; attrsOf str;
|
||||
default = { };
|
||||
};
|
||||
|
||||
environmentFile = mkOption {
|
||||
type = with types; path;
|
||||
default = "";
|
||||
@@ -42,23 +42,21 @@
|
||||
ports = [
|
||||
"${toString cfg.port}:3000"
|
||||
];
|
||||
|
||||
environment = cfg.environment;
|
||||
environment = {
|
||||
ADDON_ID = "${cfg.domain}";
|
||||
BASE_URL = "https://${cfg.domain}";
|
||||
};
|
||||
environmentFiles = [ cfg.environmentFile ];
|
||||
volumes = [
|
||||
"${cfg.dataDir}:/app/data"
|
||||
];
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts = {
|
||||
"${cfg.environment.ADDON_ID}" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "lab.tux.rs";
|
||||
locations = {
|
||||
"/" = {
|
||||
proxyPass = "http://localhost:${toString cfg.port}";
|
||||
};
|
||||
};
|
||||
services.nginx.virtualHosts.${cfg.domain} = {
|
||||
forceSSL = true;
|
||||
useACMEHost = config.tnix.services.nginx.domain;
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:${toString cfg.port}";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
default = 8888;
|
||||
};
|
||||
|
||||
environment = mkOption {
|
||||
type = with types; attrsOf str;
|
||||
default = { };
|
||||
domain = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
};
|
||||
|
||||
environmentFile = mkOption {
|
||||
@@ -36,20 +36,19 @@
|
||||
ports = [
|
||||
"${toString cfg.port}:8888"
|
||||
];
|
||||
|
||||
environment = cfg.environment;
|
||||
environment = {
|
||||
APP__SERVER__HOST = "0.0.0.0";
|
||||
APP__SERVER__PORT = "${toString cfg.port}";
|
||||
};
|
||||
environmentFiles = [ cfg.environmentFile ];
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts = {
|
||||
"mf-proxy.lab.tux.rs" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "lab.tux.rs";
|
||||
locations = {
|
||||
"/" = {
|
||||
proxyPass = "http://localhost:${toString cfg.port}";
|
||||
};
|
||||
};
|
||||
services.nginx.virtualHosts.${cfg.domain} = {
|
||||
forceSSL = true;
|
||||
useACMEHost = config.tnix.services.nginx.domain;
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:${toString cfg.port}";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -43,12 +43,10 @@
|
||||
|
||||
nginx.virtualHosts.${cfg.domain} = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "lab.tux.rs";
|
||||
locations = {
|
||||
"/" = {
|
||||
proxyPass = "http://localhost:${toString cfg.port}";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
useACMEHost = config.tnix.services.nginx.domain;
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:${toString cfg.port}";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user