2023-06-04 14:29:21 +02:00
|
|
|
# to download things
|
2024-07-28 21:08:02 +02:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
2023-06-04 14:29:21 +02:00
|
|
|
let
|
|
|
|
cfg = config.my.services.aria2;
|
2023-11-07 23:13:51 +01:00
|
|
|
inherit (config.networking) domain;
|
2023-06-04 14:29:21 +02:00
|
|
|
in
|
|
|
|
{
|
|
|
|
options.my.services.aria2 = with lib; {
|
|
|
|
enable = mkEnableOption "Aria2 for downloads";
|
|
|
|
|
|
|
|
downloadDir = mkOption {
|
|
|
|
type = types.path;
|
2024-12-30 12:01:57 +01:00
|
|
|
description = ''
|
2023-06-04 14:29:21 +02:00
|
|
|
Directory to store downloaded files.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
services.aria2 = {
|
2023-06-04 14:30:45 +02:00
|
|
|
enable = true;
|
|
|
|
openPorts = true;
|
2023-06-04 14:29:21 +02:00
|
|
|
inherit (cfg) downloadDir;
|
|
|
|
};
|
|
|
|
|
2025-01-26 00:34:16 +01:00
|
|
|
my.services.webserver.virtualHosts = [
|
2023-06-04 14:29:21 +02:00
|
|
|
{
|
|
|
|
subdomain = "download";
|
|
|
|
root = "${pkgs.ariang}/share/ariang";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
webapps.apps.aria2 = {
|
|
|
|
dashboard = {
|
|
|
|
name = "Download";
|
|
|
|
category = "app";
|
|
|
|
icon = "download";
|
2023-11-12 20:39:44 +01:00
|
|
|
url = "https://download.${domain}";
|
2023-06-04 14:29:21 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|