configuration.nix/home/services/aria2c.nix

40 lines
1 KiB
Nix
Raw Normal View History

2023-11-04 16:12:45 +05:30
{ config
, pkgs
, secrets
, ...
2023-05-18 16:11:26 +05:30
}: {
2023-07-09 22:14:29 +05:30
systemd.user.services = {
ariang = {
Unit = {
Description = "AriaNg: Web frontend for aria2c";
2023-11-04 16:12:45 +05:30
After = [ "network.target" "aria2c.service" ];
2023-07-09 22:14:29 +05:30
};
Install = {
2023-11-04 16:12:45 +05:30
WantedBy = [ "default.target" ];
2023-07-09 22:14:29 +05:30
};
Service = {
Type = "simple";
ExecStart = ''
${pkgs.merecat}/bin/merecat -n -p 6801 "${pkgs.ariang}/share/ariang"
'';
};
2023-05-13 00:31:26 +05:30
};
2023-07-09 22:14:29 +05:30
aria2c = {
Unit = {
Description = "Aria2c Download Manager";
2023-11-04 16:12:45 +05:30
Documentation = [ "man:aria2c(1)" ];
After = [ "network.target" ];
2023-07-09 22:14:29 +05:30
};
Install = {
2023-11-04 16:12:45 +05:30
WantedBy = [ "default.target" "ariang.service" ];
2023-07-09 22:14:29 +05:30
};
Service = {
Type = "simple";
ExecStart = ''
2023-10-18 22:01:05 +05:30
${pkgs.aria}/bin/aria2c --console-log-level=warn --log-level=notice --enable-rpc --rpc-secret="${secrets.aria2_config.rpc_secret}" --rpc-listen-port=6800 --rpc-allow-origin-all --rpc-listen-all --dir="${config.xdg.userDirs.download}"
2023-07-09 22:14:29 +05:30
'';
};
2023-05-13 00:31:26 +05:30
};
};
}