35 lines
1.2 KiB
Nix
35 lines
1.2 KiB
Nix
{ lib, config, proxyReverse, ... }:
|
|
let
|
|
port = 9078;
|
|
domain = "scrobble.${config.my.domain}";
|
|
url = "https://${domain}";
|
|
in {
|
|
options.my.servers.multi-scrobbler.enable = lib.mkEnableOption "enable";
|
|
config = lib.mkIf config.my.servers.multi-scrobbler.enable {
|
|
sops.secrets.multi-scrobbler.sopsFile = ../../secrets/env.yaml;
|
|
virtualisation.oci-containers.containers.multi-scrobbler = {
|
|
image = "foxxmd/multi-scrobbler";
|
|
ports = [ "${toString port}:${toString port}" ];
|
|
environmentFiles = [ config.sops.secrets.multi-scrobbler.path ];
|
|
environment = {
|
|
TZ = "America/Mexico_City";
|
|
PUID = "1000";
|
|
PGID = "100";
|
|
BASE_URL = url;
|
|
DEEZER_REDIRECT_URI =
|
|
"http://${config.my.miniserver-ip}:${toString port}/deezer/callback";
|
|
MALOJA_URL = "http://maloja:42010";
|
|
WS_ENABLE = "true";
|
|
};
|
|
volumes = [ "${config.my.containerData}/multi-scrobbler:/config" ];
|
|
labels = {
|
|
"flame.type" = "application";
|
|
"flame.name" = "Multi-scrobbler";
|
|
"flame.url" = url;
|
|
"flame.icon" = "broadcast";
|
|
};
|
|
};
|
|
services.nginx.virtualHosts."${domain}" = proxyReverse port // { };
|
|
};
|
|
}
|