configuration.nix/home/services/aria2c.nix

41 lines
1 KiB
Nix
Raw Normal View History

2023-05-18 16:11:26 +05:30
{
config,
pkgs,
2023-07-09 17:03:38 +05:30
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";
After = ["network.target" "aria2c.service"];
};
Install = {
WantedBy = ["default.target"];
};
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";
Documentation = ["man:aria2c(1)"];
After = ["network.target"];
};
Install = {
WantedBy = ["default.target" "ariang.service"];
};
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
};
};
}