2021-05-23 00:32:59 +02:00
|
|
|
# A simple podcast fetcher
|
2021-09-24 01:15:40 +02:00
|
|
|
{ config, lib, ... }:
|
2021-04-02 11:07:58 +02:00
|
|
|
let
|
|
|
|
cfg = config.my.services.podgrab;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.my.services.podgrab = with lib; {
|
|
|
|
enable = mkEnableOption "Podgrab, a self-hosted podcast manager";
|
|
|
|
|
|
|
|
passwordFile = mkOption {
|
|
|
|
type = with types; nullOr str;
|
|
|
|
default = null;
|
|
|
|
example = "/run/secrets/password.env";
|
|
|
|
description = ''
|
|
|
|
The path to a file containing the PASSWORD environment variable
|
|
|
|
definition for Podgrab's authentification.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2024-03-21 20:30:25 +01:00
|
|
|
dataDir = mkOption {
|
|
|
|
type = with types; nullOr str;
|
|
|
|
default = null;
|
|
|
|
example = "/mnt/podgrab";
|
|
|
|
description = ''
|
|
|
|
Path to the directory to store the podcasts. Use default if null
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2021-04-02 11:07:58 +02:00
|
|
|
port = mkOption {
|
|
|
|
type = types.port;
|
|
|
|
default = 8080;
|
|
|
|
example = 4242;
|
|
|
|
description = "The port on which Podgrab will listen for incoming HTTP traffic.";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
2021-05-22 22:50:05 +02:00
|
|
|
services.podgrab = {
|
|
|
|
enable = true;
|
|
|
|
inherit (cfg) passwordFile port;
|
2024-03-21 20:30:25 +01:00
|
|
|
|
|
|
|
group = "media";
|
2024-03-21 20:30:25 +01:00
|
|
|
dataDirectory = lib.mkIf (cfg.dataDir != null) cfg.dataDir;
|
2021-04-02 11:07:58 +02:00
|
|
|
};
|
|
|
|
|
2024-03-21 20:30:25 +01:00
|
|
|
# Set-up media group
|
|
|
|
users.groups.media = { };
|
|
|
|
|
2023-12-25 19:25:08 +01:00
|
|
|
my.services.nginx.virtualHosts = {
|
|
|
|
podgrab = {
|
2021-08-24 23:05:10 +02:00
|
|
|
inherit (cfg) port;
|
2023-12-25 19:25:08 +01:00
|
|
|
};
|
|
|
|
};
|
2021-04-02 11:07:58 +02:00
|
|
|
};
|
|
|
|
}
|