1 { config, lib, pkgs, ... }:
3 cfg = config.services.podgrab;
6 options.services.podgrab = with lib; {
7 enable = mkEnableOption (lib.mdDoc "Podgrab, a self-hosted podcast manager");
9 passwordFile = mkOption {
10 type = with types; nullOr str;
12 example = "/run/secrets/password.env";
13 description = lib.mdDoc ''
14 The path to a file containing the PASSWORD environment variable
15 definition for Podgrab's authentification.
23 description = lib.mdDoc "The port on which Podgrab will listen for incoming HTTP traffic.";
27 config = lib.mkIf cfg.enable {
28 systemd.services.podgrab = {
29 description = "Podgrab podcast manager";
30 wantedBy = [ "multi-user.target" ];
32 CONFIG = "/var/lib/podgrab/config";
33 DATA = "/var/lib/podgrab/data";
35 PORT = toString cfg.port;
39 EnvironmentFile = lib.optionals (cfg.passwordFile != null) [
42 ExecStart = "${pkgs.podgrab}/bin/podgrab";
43 WorkingDirectory = "${pkgs.podgrab}/share";
44 StateDirectory = [ "podgrab/config" "podgrab/data" ];
49 meta.maintainers = with lib.maintainers; [ ambroisie ];