aboutsummaryrefslogtreecommitdiffstats
path: root/modules/web/aria2/default.nix
blob: 60e92c6689d37bf2bf69e7502c9e17504c68fa3f (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
28
29
30
31
# Command line download manager
{
  config,
  lib,
  pkgs,
  ...
}:
let
  cfg = config.web.aria2;
in
{
  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 cfg.enable {
    programs.aria2 = {
      enable = true;
      settings = {
        dir = "${config.home.homeDirectory}/Downloads";
      };
      systemd.enable = true;
    };
  };
}