aboutsummaryrefslogtreecommitdiff
path: root/modules/containers/freshrss/default.nix
blob: 5f352a7a8f2821d8019e29ea760bb15b255e43b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{ lib, ... }:
let
  inherit (lib.lists) singleton;
  directory = "/opt/freshrss";
  port = "8888";
in
{
  systemd.tmpfiles.rules = builtins.map (x: "d ${x} 0755 share share - -") (singleton directory);

  virtualisation.oci-containers.containers.freshrss = {
    image = "freshrss/freshrss:latest";
    autoStart = true;
    ports = singleton "${port}:80";
    volumes = [
      "${directory}/data:/var/www/FreshRSS/data"
      "${directory}/extensions:/var/www/FreshRSS/extensions"
    ];
    environment = {
      TZ = "America/Detroit";
      CRON_MIN = "*/20";
    };
  };

  services.caddy.virtualHosts."fresh.brownbread.net".extraConfig = ''
    encode zstd gzip
    reverse_proxy http://localhost:${port}
  '';
}