diff --git a/nixosConfigurations/catarina/default.nix b/nixosConfigurations/catarina/default.nix index 6b1f0cb..94d6406 100644 --- a/nixosConfigurations/catarina/default.nix +++ b/nixosConfigurations/catarina/default.nix @@ -281,8 +281,6 @@ fzf grc - gcc - cachix gnupg diff --git a/nixosConfigurations/catarina/hardware.nix b/nixosConfigurations/catarina/hardware.nix index e2e9147..c3a79da 100644 --- a/nixosConfigurations/catarina/hardware.nix +++ b/nixosConfigurations/catarina/hardware.nix @@ -150,6 +150,12 @@ defaultGateway = "192.168.156.1"; nameservers = ["192.168.156.1" "8.8.8.8"]; + + nat = { + enable = true; + externalInterface = "enp9s0"; + internalInterfaces = ["ve-+"]; + }; }; services.logind.lidSwitchExternalPower = "ignore"; diff --git a/nixosConfigurations/catarina/services/radio.nix b/nixosConfigurations/catarina/services/radio.nix index 53ae3da..52fd00a 100644 --- a/nixosConfigurations/catarina/services/radio.nix +++ b/nixosConfigurations/catarina/services/radio.nix @@ -1,32 +1,52 @@ {config, ...}: { - services.mpd = { - enable = true; - musicDirectory = "/home/l-nafaryus/Music"; - network.listenAddress = "any"; - network.startWhenNeeded = true; - user = "l-nafaryus"; - extraConfig = '' - audio_output { - type "httpd" - name "Radio" - port "6666" - bind_to_address "127.0.0.1" - encoder "lame" - max_clients "0" - website "https://radio.elnafo.ru" - always_on "yes" - tags "yes" - bitrate "128" - format "44100:16:1" - } - ''; + containers.radio-synthwave = { + autoStart = true; + privateNetwork = true; + + config = { + config, + pkgs, + lib, + ... + }: { + services.mpd = { + enable = true; + musicDirectory = "/home/l-nafaryus/Music"; + network.listenAddress = "any"; + #network.startWhenNeeded = true; + user = "l-nafaryus"; + network.port = 6600; + extraConfig = '' + 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" = { forceSSL = true; 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]; }