aboutsummaryrefslogtreecommitdiffstats
path: root/modules/web/aria2/default.nix
blob: 77b25bb6e91ab8284c4a275165c2cd92b5217dd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Aria2 - command line download manager
{
  lib,
  config,
  ...
}:
{
  options.web.aria2 = {
    enable = lib.mkEnableOption "Enables aria2.";
    package = lib.mkOption {
      type = lib.types.package;
      readOnly = true;
      default = config.programs.aria2.package;
      description = "The aria2 package to use.";
    };
  };

  config = lib.mkIf config.web.aria2.enable {
    programs.aria2 = {
      enable = true;
      settings = {
        dir = "${config.home.homeDirectory}/Downloads";
      };
      systemd.enable = true;
    };
  };
}