diff --git a/hosts/web-2/feeds.nix b/hosts/web-2/feeds.nix index e684f8d..3ddb2e4 100644 --- a/hosts/web-2/feeds.nix +++ b/hosts/web-2/feeds.nix @@ -9,6 +9,7 @@ users.groups."feeds" = {}; systemd.tmpfiles.rules = [ + "d /data/feeds 0775 root users - -" "d /var/lib/feeds - feeds feeds - -" ]; @@ -31,7 +32,7 @@ User = "feeds"; Group = "feeds"; ExecStart = '' - ${pkgs.feeds-dir}/bin/feeds-dir + ${pkgs.feeds-dir}/bin/feeds-dir /data/feeds ''; }; }; diff --git a/pkgs/feeds-dir/feeds-dir.sh b/pkgs/feeds-dir/feeds-dir.sh index 876c7fb..5b385b6 100755 --- a/pkgs/feeds-dir/feeds-dir.sh +++ b/pkgs/feeds-dir/feeds-dir.sh @@ -2,6 +2,8 @@ set -euo pipefail -for file in ./*.txt; do +IN_DIR="${1:-.}" + +for file in "${IN_DIR}"/*.txt; do rainbowrss --feeds "${file}" --out "$(basename "${file}" ".txt").html" || true done