summaryrefslogtreecommitdiffstats
path: root/lass/2configs/snapserver.nix
blob: 60aa97077849264587a7b2c3f5107dcb9882da64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{ config, lib, pkgs, ... }:
{
  services.snapserver = {
    enable = true;
    # openFirewall = true;
    streams = {
      radio = {
        type = "process";
        location = pkgs.writers.writeDash "radio" ''
          exec ${pkgs.mpv}/bin/mpv http://radio.lassul.us/radio.ogg \
            --no-terminal \
            --audio-display=no \
            --audio-channels=stereo \
            --audio-samplerate=48000 \
            --audio-format=s16 \
            --ao=pcm \
            --ao-pcm-file=/dev/stdout
        '';
      };
      styx = {
        type = "pipe";
        location = "/run/snapserver/snapfifo";
      };
    };
    http.enable = true;
  };

  networking.firewall.interfaces.int0.allowedTCPPorts = [ 1704 1705 1780 ];
  networking.firewall.interfaces.retiolum.allowedTCPPorts = [ 1780 ];
}