catarina: try to split radio service to isolated services (incomplete)

This commit is contained in:
L-Nafaryus 2024-09-20 23:09:45 +05:00
parent f68d7a7e3a
commit 484529aaa2
Signed by: L-Nafaryus
GPG Key ID: 553C97999B363D38
3 changed files with 49 additions and 25 deletions

View File

@ -281,8 +281,6 @@
fzf fzf
grc grc
gcc
cachix cachix
gnupg gnupg

View File

@ -150,6 +150,12 @@
defaultGateway = "192.168.156.1"; defaultGateway = "192.168.156.1";
nameservers = ["192.168.156.1" "8.8.8.8"]; nameservers = ["192.168.156.1" "8.8.8.8"];
nat = {
enable = true;
externalInterface = "enp9s0";
internalInterfaces = ["ve-+"];
};
}; };
services.logind.lidSwitchExternalPower = "ignore"; services.logind.lidSwitchExternalPower = "ignore";

View File

@ -1,32 +1,52 @@
{config, ...}: { {config, ...}: {
services.mpd = { containers.radio-synthwave = {
enable = true; autoStart = true;
musicDirectory = "/home/l-nafaryus/Music"; privateNetwork = true;
network.listenAddress = "any";
network.startWhenNeeded = true; config = {
user = "l-nafaryus"; config,
extraConfig = '' pkgs,
audio_output { lib,
type "httpd" ...
name "Radio" }: {
port "6666" services.mpd = {
bind_to_address "127.0.0.1" enable = true;
encoder "lame" musicDirectory = "/home/l-nafaryus/Music";
max_clients "0" network.listenAddress = "any";
website "https://radio.elnafo.ru" #network.startWhenNeeded = true;
always_on "yes" user = "l-nafaryus";
tags "yes" network.port = 6600;
bitrate "128" extraConfig = ''
format "44100:16:1" audio_output {
} type "httpd"
''; name "Radio"
port "6660"
bind_to_address "127.0.0.1"
encoder "lame"
max_clients "0"
website "https://radio.elnafo.ru/synthwave"
always_on "yes"
tags "yes"
bitrate "128"
format "44100:16:1"
}
'';
};
system.stateVersion = "24.05";
networking.firewall = {
enable = true;
allowedTCPPorts = [6600 6660];
};
};
}; };
services.nginx.virtualHosts."radio.elnafo.ru" = { services.nginx.virtualHosts."radio.elnafo.ru" = {
forceSSL = true; forceSSL = true;
useACMEHost = "elnafo.ru"; useACMEHost = "elnafo.ru";
locations."/synthwave".proxyPass = "http://127.0.0.1:6666"; locations."/synthwave".proxyPass = "http://127.0.0.1:6660";
}; };
networking.firewall.allowedTCPPorts = [config.services.mpd.network.port]; networking.firewall.allowedTCPPorts = [6600];
} }