refactor: switch from modules to import arrays
This commit is contained in:
parent
d893750c09
commit
41eaa38d31
75 changed files with 1870 additions and 2541 deletions
|
|
@ -1,37 +1,28 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
feature = "qbittorrent";
|
||||
port = "5005";
|
||||
in
|
||||
{
|
||||
config = lib.mkIf config.${feature}.enable {
|
||||
users.users.qbittorrent.extraGroups = [ "media" ];
|
||||
services = {
|
||||
qbittorrent = {
|
||||
enable = true;
|
||||
webuiPort = lib.toInt port;
|
||||
profileDir = "/srv";
|
||||
group = "media";
|
||||
extraArgs = [
|
||||
"--confirm-legal-notice"
|
||||
];
|
||||
};
|
||||
|
||||
services = {
|
||||
# service
|
||||
qbittorrent = {
|
||||
enable = true;
|
||||
webuiPort = lib.toInt port;
|
||||
profileDir = "/srv";
|
||||
group = "media";
|
||||
extraArgs = [
|
||||
"--confirm-legal-notice"
|
||||
];
|
||||
};
|
||||
|
||||
# reverse proxy
|
||||
nginx = {
|
||||
virtualHosts."${feature}.fi33.buzz" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "fi33.buzz";
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:${port}";
|
||||
# proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
nginx.virtualHosts."qbittorrent.fi33.buzz" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "fi33.buzz";
|
||||
locations."/".proxyPass = "http://localhost:${port}";
|
||||
};
|
||||
};
|
||||
|
||||
options.${feature}.enable = lib.mkEnableOption "enables ${feature}";
|
||||
users.users.qbittorrent.extraGroups = [ "media" ];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue