mirror of
https://github.com/tuxdotrs/nix-config.git
synced 2025-12-15 23:00:06 +05:30
53 lines
1.0 KiB
Nix
53 lines
1.0 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
...
|
|
}:
|
|
with lib; let
|
|
cfg = config.tux.containers.aiostreams;
|
|
in {
|
|
options.tux.containers.aiostreams = {
|
|
enable = mkEnableOption "Enable AIOStreams";
|
|
|
|
port = mkOption {
|
|
type = types.int;
|
|
default = 3000;
|
|
};
|
|
|
|
environment = mkOption {
|
|
type = with types; attrsOf str;
|
|
default = {};
|
|
};
|
|
|
|
environmentFiles = mkOption {
|
|
type = with types; listOf path;
|
|
default = [];
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
virtualisation.oci-containers.containers.aiostreams = {
|
|
autoStart = true;
|
|
image = "ghcr.io/viren070/aiostreams:latest";
|
|
ports = [
|
|
"${toString cfg.port}:3000"
|
|
];
|
|
|
|
environment = cfg.environment;
|
|
environmentFiles = cfg.environmentFiles;
|
|
};
|
|
|
|
services.nginx.virtualHosts = {
|
|
"${cfg.environment.ADDON_ID}" = {
|
|
forceSSL = true;
|
|
useACMEHost = "tux.rs";
|
|
locations = {
|
|
"/" = {
|
|
proxyPass = "http://localhost:${toString cfg.port}";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|