35 lines
751 B
Nix
35 lines
751 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
inherit (lib) mkIf;
|
|
|
|
cfg = config.pepe.services.whisparr;
|
|
in
|
|
{
|
|
options.pepe.services.whisparr = with lib; {
|
|
enable = mkEnableOption "Enable whisparr";
|
|
package = mkPackageOption pkgs "whisparr" { };
|
|
domain = mkOption {
|
|
type = types.str;
|
|
default = null;
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
services.whisparr = {
|
|
enable = true;
|
|
package = cfg.package;
|
|
};
|
|
|
|
pepe.core.vhost.hosts.${cfg.domain} = {
|
|
locations."/" = {
|
|
port = config.services.whisparr.settings.server.port;
|
|
allowLAN = true;
|
|
allowVPN = true;
|
|
};
|
|
};
|
|
|
|
pepe.core.media.groupMembers = mkIf config.pepe.core.media.enable [ config.services.whisparr.group ];
|
|
};
|
|
}
|