aboutsummaryrefslogtreecommitdiff
path: root/home-manager/tests/modules/programs/aria2/settings.nix
blob: 0b5a52d90c522784dad48bac33466c0a662ae5ec (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
32
33
34
35
36
37
38
39
40
41
{ config, lib, pkgs, ... }:

with lib;

{
  config = {
    programs.aria2 = {
      enable = true;

      settings = {
        listen-port = 60000;
        dht-listen-port = 60000;
        seed-ratio = 1.0;
        max-upload-limit = "50K";
        ftp-pasv = true;
      };

      extraConfig = ''
        # Extra aria2 configuration.
      '';
    };

    nixpkgs.overlays =
      [ (self: super: { aria2 = pkgs.writeScriptBin "dummy-aria2" ""; }) ];

    nmt.script = ''
      assertFileContent \
        home-files/.config/aria2/aria2.conf \
        ${
          pkgs.writeText "aria2-expected-config.conf" ''
            dht-listen-port=60000
            ftp-pasv=true
            listen-port=60000
            max-upload-limit=50K
            seed-ratio=1.000000
            # Extra aria2 configuration.
          ''
        }
    '';
  };
}