about summary refs log tree commit diff
path: root/modules/services/tt-rss.nix
blob: 43510657411df910db576f9cc153ab89b15d24cd (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{ config, lib, pkgs, ... }:

with lib;
let
  cfg = config.modules.services.tt-rss;
in
{
  options.modules.services.tt-rss = {
    enable = mkEnableOption "Tiny Tiny RSS Client";
    domain = mkOption { type = types.str; };
    realHost = mkOption { type = types.str; default = "rss.${cfg.domain}"; };
  };

  config = mkIf cfg.enable {
    services.tt-rss = {
      enable = true;
      virtualHost = cfg.realHost;
      selfUrlPath = "https://${cfg.realHost}";

      themePackages = [
        pkgs.tt-rss-theme-feedly
      ];

      plugins = [
        "auth_internal"
        "note"
      ];

      database = {
        type = "pgsql";
        password = null;
        host = "/run/postgresql";
      };

    };

    services.nginx.virtualHosts.${cfg.realHost} = {
      forceSSL = true;
      useACMEHost = cfg.domain;
    };
  };
}