1
0
mirror of https://github.com/kmein/niveum synced 2026-03-18 19:11:08 +01:00

fix(radio): clean up files after 1h

This commit is contained in:
2022-02-10 19:28:28 +01:00
parent db8c06364f
commit 87f73a8fc1

View File

@@ -1,5 +1,7 @@
{ lib, pkgs, config, ... }: { lib, pkgs, config, ... }:
let let
inherit (import <niveum/lib>) tmpfilesConfig;
liquidsoapDirectory = "/var/cache/liquidsoap";
icecastPassword = "hackme"; icecastPassword = "hackme";
lyrikline-poem = pkgs.writers.writeDash "lyrikline.sh" '' lyrikline-poem = pkgs.writers.writeDash "lyrikline.sh" ''
set -efu set -efu
@@ -44,7 +46,7 @@ let
''; '';
wikipedia-article = pkgs.writers.writeDash "wikipedia.sh" '' wikipedia-article = pkgs.writers.writeDash "wikipedia.sh" ''
set -efu set -efu
opus=$(mktemp /tmp/wikipedia.XXX.opus) opus=$(mktemp ${liquidsoapDirectory}/wikipedia.XXX.opus)
html=$(mktemp) html=$(mktemp)
trap clean EXIT 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 = { services.icecast = {
enable = true; enable = true;
hostname = "radio.kmein.de"; hostname = "radio.kmein.de";