summaryrefslogtreecommitdiffstats
path: root/lass/2configs/services/radio/container-host.nix
blob: de0ea9afefb2b7685a4978dc5a85f49ac6e9aae2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{ config, pkgs, ... }:
{
  krebs.sync-containers3.containers.radio = {
    sshKey = "${toString <secrets>}/radio.sync.key";
  };
  containers.radio = {
    bindMounts."/var/music" = {
      hostPath = "/var/music";
      isReadOnly = false;
    };
  };
  krebs.iptables.tables.filter.INPUT.rules = [
    { predicate = "-p tcp --dport 8000"; target = "ACCEPT"; }
  ];
  krebs.htgen.radio-redirect = {
    port = 8000;
    scriptFile = pkgs.writers.writeDash "redir" ''
      printf 'HTTP/1.1 301 Moved Permanently\r\n'
      printf "Location: http://radio.lassul.us''${Request_URI}\r\n"
      printf '\r\n'
    '';
  };
}