diff --git a/systems/makanek/radio.nix b/systems/makanek/radio.nix index 4b0dfca..8a54a52 100644 --- a/systems/makanek/radio.nix +++ b/systems/makanek/radio.nix @@ -1,5 +1,7 @@ { lib, pkgs, config, ... }: let + inherit (import ) tmpfilesConfig; + liquidsoapDirectory = "/var/cache/liquidsoap"; icecastPassword = "hackme"; lyrikline-poem = pkgs.writers.writeDash "lyrikline.sh" '' set -efu @@ -44,7 +46,7 @@ let ''; wikipedia-article = pkgs.writers.writeDash "wikipedia.sh" '' set -efu - opus=$(mktemp /tmp/wikipedia.XXX.opus) + opus=$(mktemp ${liquidsoapDirectory}/wikipedia.XXX.opus) html=$(mktemp) trap clean EXIT @@ -103,6 +105,20 @@ in { ) ''; + systemd.services.radio.environment.TMPDIR = liquidsoapDirectory; + + systemd.tmpfiles.rules = [ + (tmpfilesConfig { + type = "d"; + path = liquidsoapDirectory; + mode = "0750"; + user = "liquidsoap"; + group = "liquidsoap"; + age = "1h"; + }) + ]; + + services.icecast = { enable = true; hostname = "radio.kmein.de";