2024-12-02 19:32:24 +00:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
cfg = config.aux.system.services.rss;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
aux.system.services.rss = {
|
|
|
|
enable = lib.mkEnableOption "Enables RSS hosting service via FreshRSS.";
|
|
|
|
auth = {
|
|
|
|
password = lib.mkOption {
|
|
|
|
default = "";
|
|
|
|
type = lib.types.str;
|
|
|
|
description = "The password to use for the default user.";
|
|
|
|
example = "MySuperSecurePassword123";
|
|
|
|
};
|
|
|
|
user = lib.mkOption {
|
|
|
|
default = "ltuser";
|
|
|
|
type = lib.types.str;
|
|
|
|
description = "The username to use for the default user.";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
home = lib.mkOption {
|
|
|
|
default = "";
|
|
|
|
type = lib.types.str;
|
|
|
|
description = "Where to store FreshRSS's files";
|
|
|
|
example = "/home/freshrss";
|
|
|
|
};
|
|
|
|
url = lib.mkOption {
|
|
|
|
default = "";
|
|
|
|
type = lib.types.str;
|
|
|
|
description = "The complete URL where FreshRSS is hosted.";
|
|
|
|
example = "https://rss.example.com";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
services = {
|
|
|
|
freshrss = {
|
|
|
|
enable = true;
|
2024-12-02 19:45:04 +00:00
|
|
|
baseUrl = "https://${cfg.url}";
|
2024-12-02 19:32:24 +00:00
|
|
|
dataDir = cfg.home;
|
|
|
|
defaultUser = cfg.auth.user;
|
|
|
|
passwordFile = pkgs.writeText "rss-defaultpassword" ''
|
|
|
|
${cfg.auth.password}
|
|
|
|
'';
|
|
|
|
authType = "form";
|
|
|
|
database.type = "sqlite";
|
|
|
|
|
|
|
|
virtualHost = cfg.url;
|
|
|
|
};
|
|
|
|
|
|
|
|
nginx.virtualHosts."${cfg.url}" = {
|
2024-12-03 23:05:57 +00:00
|
|
|
useACMEHost = pkgs.util.getDomainFromURI cfg.url;
|
2024-12-02 19:32:24 +00:00
|
|
|
forceSSL = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.services = {
|
|
|
|
freshrss.unitConfig.RequiresMountsFor = cfg.home;
|
|
|
|
nginx.wants = [ config.systemd.services.freshrss.name ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|