about summary refs log tree commit diff
path: root/modules/common/aria2.nix
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2023-02-19 17:50:35 +0300
committerAzat Bahawi <azat@bahawi.net>2023-02-19 17:50:35 +0300
commit91fb4f28ef5d87e8bcf7749928d30ba4a9cbbd34 (patch)
treee07291fcb1cf62a561ffe58d1fd8e2968ff6fcb3 /modules/common/aria2.nix
parent2023-02-15 (diff)
2023-02-19
Diffstat (limited to 'modules/common/aria2.nix')
-rw-r--r--modules/common/aria2.nix36
1 files changed, 36 insertions, 0 deletions
diff --git a/modules/common/aria2.nix b/modules/common/aria2.nix
new file mode 100644
index 0000000..f33acb9
--- /dev/null
+++ b/modules/common/aria2.nix
@@ -0,0 +1,36 @@
+{
+  config,
+  lib,
+  pkgs,
+  ...
+}:
+with lib; let
+  cfg = config.nixfiles.modules.aria2;
+in {
+  options.nixfiles.modules.aria2.enable = mkEnableOption "aria2";
+
+  config = mkIf cfg.enable {
+    hm.programs.aria2 = {
+      enable = true;
+
+      settings = {
+        bt-max-peers = 128;
+        bt-save-metadata = true;
+        continue = true;
+        enable-dht = true;
+        enable-peer-exchange = true;
+        enable-rpc = false;
+        follow-torrent = true;
+        log-level = "info";
+        max-connection-per-server = 16;
+        max-overall-upload-limit = "1K";
+        max-tries = 5;
+        max-upload-limit = "1K";
+        seed-ratio = 0.1;
+        seed-time = 0.1;
+        stream-piece-selector = "default";
+        timeout = 60;
+      };
+    };
+  };
+}

Consider giving Nix/NixOS a try! <3