nixos: services: add pyload
This commit is contained in:
parent
63314c9a4a
commit
924fa54371
2 changed files with 67 additions and 0 deletions
|
|
@ -26,6 +26,7 @@
|
|||
./podgrab
|
||||
./postgresql
|
||||
./postgresql-backup
|
||||
./pyload
|
||||
./quassel
|
||||
./rss-bridge
|
||||
./sabnzbd
|
||||
|
|
|
|||
66
modules/nixos/services/pyload/default.nix
Normal file
66
modules/nixos/services/pyload/default.nix
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.services.pyload;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./nixos.nix
|
||||
];
|
||||
|
||||
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";
|
||||
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
|
||||
;
|
||||
};
|
||||
|
||||
# User media group when downloading files
|
||||
systemd. services. pyload = {
|
||||
serviceConfig = {
|
||||
Group = lib.mkForce "media";
|
||||
};
|
||||
};
|
||||
|
||||
# Set-up media group
|
||||
users.groups.media = { };
|
||||
|
||||
my.services.nginx.virtualHosts = [
|
||||
{
|
||||
subdomain = "pyload";
|
||||
# FIXME: use actual port
|
||||
inherit (cfg) port;
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue