stockholm/lass/2configs/services/radio/container-host.nix

24 lines
621 B
Nix
Raw Normal View History

2023-01-07 22:35:39 +00:00
{ config, pkgs, ... }:
{
2023-01-30 19:53:24 +00:00
krebs.sync-containers3.containers.radio = {
2023-01-07 22:35:39 +00:00
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'
'';
};
}