summary refs log tree commit diff
path: root/services/freshrss.nix
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2024-12-08 03:34:42 +0100
committerMel <einebeere@gmail.com>2024-12-08 03:34:55 +0100
commit3ffb1a24cba360070727c250aa93eca343c7da62 (patch)
treeb171471d40d2b0dbac6e0288a08d32c58b7c333b /services/freshrss.nix
parentf98c19100ac3eb73690e2654e6b1fe6b0eed1763 (diff)
downloadnetwork-3ffb1a24cba360070727c250aa93eca343c7da62.tar.zst
network-3ffb1a24cba360070727c250aa93eca343c7da62.zip
Partially working FreshRSS service
Signed-off-by: Mel <einebeere@gmail.com>
Diffstat (limited to 'services/freshrss.nix')
-rw-r--r--services/freshrss.nix44
1 files changed, 44 insertions, 0 deletions
diff --git a/services/freshrss.nix b/services/freshrss.nix
new file mode 100644
index 0000000..bdb087f
--- /dev/null
+++ b/services/freshrss.nix
@@ -0,0 +1,44 @@
+{ me, pkgs, auxiliaryPkgs, ... }:
+
+let
+  inherit (pkgs) php lighttpd freshrss dockerTools;
+  inherit (auxiliaryPkgs) common;
+
+  freshrssLocalPort = 1819;
+  freshrssDir = "/srv/freshrss";
+
+  freshrssImage = dockerTools.streamLayeredImage {
+    name = "freshrss";
+    tag = freshrss.version;
+    fromImage = common.alpine.base;
+
+    contents = [ lighttpd freshrss php ];
+
+    extraCommands = ''
+      mkdir -p ./opt ./var/log/lighttpd
+      touch ./var/log/lighttpd/access.log ./var/log/lighttpd/error.log
+      ln -s ${freshrss} ./opt/freshrss
+    '';
+  };
+
+in
+{
+  # TODO: ..it won't work without cron :3
+  foundation.services.freshrss = {
+    image = freshrssImage;
+    ports = [
+      (common.tailnetPort me [ freshrssLocalPort 80 ])
+    ];
+
+    volumes = [
+      [ "${freshrssDir}/lighttpd.conf" "/etc/lighttpd/freshrss.conf" ]
+      [ "${freshrssDir}/data" "/opt/freshrss/data" ]
+    ];
+
+    entrypoint = "${lighttpd}/bin/lighttpd";
+    cmd = [
+      "-D" # run in foreground
+      "-f" "/etc/lighttpd/freshrss.conf"
+    ];
+  };
+}