mirror of
https://github.com/Stunkymonkey/nixos.git
synced 2025-05-24 09:54:40 +02:00
service/aria2: init
This commit is contained in:
parent
f8bb1d0886
commit
82a5f35ebd
2 changed files with 47 additions and 0 deletions
46
modules/services/aria2/default.nix
Normal file
46
modules/services/aria2/default.nix
Normal file
|
@ -0,0 +1,46 @@
|
|||
# to download things
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.my.services.aria2;
|
||||
domain = config.networking.domain;
|
||||
in
|
||||
{
|
||||
options.my.services.aria2 = with lib; {
|
||||
enable = mkEnableOption "Aria2 for downloads";
|
||||
|
||||
downloadDir = mkOption {
|
||||
type = types.path;
|
||||
default = "/srv/data/tmp/aria2/";
|
||||
description = mdDoc ''
|
||||
Directory to store downloaded files.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.aria2 = {
|
||||
# enable = true;
|
||||
inherit (cfg) downloadDir;
|
||||
};
|
||||
|
||||
systemd.services.aria2 = {
|
||||
after = [ "network-online.target" ];
|
||||
};
|
||||
|
||||
my.services.nginx.virtualHosts = [
|
||||
{
|
||||
subdomain = "download";
|
||||
root = "${pkgs.ariang}/share/ariang";
|
||||
}
|
||||
];
|
||||
|
||||
webapps.apps.aria2 = {
|
||||
dashboard = {
|
||||
name = "Download";
|
||||
category = "app";
|
||||
icon = "download";
|
||||
link = "https://download.${domain}";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -2,6 +2,7 @@
|
|||
{
|
||||
imports = [
|
||||
./alertmanager
|
||||
./aria2
|
||||
./backup
|
||||
./bazarr
|
||||
./blocky
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue