mirror of
https://github.com/tuxdotrs/nix-config.git
synced 2025-12-15 23:00:06 +05:30
feat: add aiostreams
This commit is contained in:
52
modules/nixos/selfhosted/containers/aiostreams.nix
Normal file
52
modules/nixos/selfhosted/containers/aiostreams.nix
Normal file
@@ -0,0 +1,52 @@
|
||||
{
|
||||
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}";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user