aboutsummaryrefslogtreecommitdiff
path: root/modules/rss/default.nix
blob: 9473c30421f481b535f4ef5fd6bcb64ef4766279 (plain) (blame)
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
{ pkgs, settings, phenax-yayarr, ... }@attrs:
let
  ports = settings.network.ports;
  yarr = settings.yarr;
  utils = import ./utils.nix attrs;

  yarrSetupScript = utils.createYarrSetupScript {
    inherit (yarr) username api_key;
    api_url = "http://localhost:${toString ports.yarr}";
    feeds = import ./feeds.nix;
    settings = {
      theme_font = "monospace";
      theme_name = "night";
      theme_size = 1.1;
      refresh_rate = 30;
    };
  };
in
{
  services.yarr = {
    enable = true;
    port = ports.yarr;
    address = "0.0.0.0";
    package = phenax-yayarr;
    authFilePath = pkgs.writeText "yarr-auth" ''${yarr.username}:${yarr.password}'';
  };

  networking.firewall.allowedTCPPorts = [ ports.yarr ];

  environment.systemPackages = [ yarrSetupScript ];
}