nix-config/modules/nixos/services/pyload/default.nix
Bruno BELANYI b9b47fffd6
All checks were successful
ci/woodpecker/push/check Pipeline was successful
flake: bump inputs
Fix the pyLoad user/group option that I added upstream [1].

Fix an evaluation error due to Pipewire changes [2].

[1]: https://github.com/NixOS/nixpkgs/pull/287304
[2]: https://github.com/NixOS/nixpkgs/pull/282377
2024-02-29 12:20:53 +00:00

59 lines
1.2 KiB
Nix

{ config, lib, ... }:
let
cfg = config.my.services.pyload;
in
{
options.my.services.pyload = with lib; {
enable = mkEnableOption "pyload download manager";
credentialsFile = mkOption {
type = types.path;
example = "/run/secrets/pyload-credentials.env";
description = "pyload credentials";
};
downloadDirectory = mkOption {
type = types.str;
default = "/data/downloads/pyload";
example = "/var/lib/pyload/download";
description = "Download directory";
};
port = mkOption {
type = types.port;
default = 9093;
example = 8080;
description = "Internal port for webui";
};
};
config = lib.mkIf cfg.enable {
services.pyload = {
enable = true;
# Listening on `localhost` leads to 502 with the reverse proxy...
listenAddress = "127.0.0.1";
inherit (cfg)
credentialsFile
downloadDirectory
port
;
# Use media group when downloading files
group = "media";
};
# Set-up media group
users.groups.media = { };
my.services.nginx.virtualHosts = {
pyload = {
inherit (cfg) port;
};
};
# FIXME: fail2ban
};
}