2020-10-12 00:22:58 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.programs.rtorrent;
|
|
|
|
|
|
|
|
in {
|
2023-08-08 10:19:01 +00:00
|
|
|
meta.maintainers = [ ];
|
2020-10-12 00:22:58 +00:00
|
|
|
|
2023-01-10 09:35:00 +00:00
|
|
|
imports = [
|
|
|
|
(mkRenamedOptionModule # \
|
|
|
|
[ "programs" "rtorrent" "settings" ] # \
|
|
|
|
[ "programs" "rtorrent" "extraConfig" ])
|
|
|
|
];
|
|
|
|
|
2020-10-12 00:22:58 +00:00
|
|
|
options.programs.rtorrent = {
|
|
|
|
enable = mkEnableOption "rTorrent";
|
|
|
|
|
2023-01-10 09:35:00 +00:00
|
|
|
extraConfig = mkOption {
|
2020-10-12 00:22:58 +00:00
|
|
|
type = types.lines;
|
|
|
|
default = "";
|
|
|
|
description = ''
|
|
|
|
Configuration written to
|
2023-08-08 10:19:01 +00:00
|
|
|
{file}`$XDG_CONFIG_HOME/rtorrent/rtorrent.rc`. See
|
|
|
|
<https://github.com/rakshasa/rtorrent/wiki/Config-Guide>
|
2020-10-12 00:22:58 +00:00
|
|
|
for explanation about possible values.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
home.packages = [ pkgs.rtorrent ];
|
|
|
|
|
|
|
|
xdg.configFile."rtorrent/rtorrent.rc" =
|
2023-01-10 09:35:00 +00:00
|
|
|
mkIf (cfg.extraConfig != "") { text = cfg.extraConfig; };
|
2020-10-12 00:22:58 +00:00
|
|
|
};
|
|
|
|
}
|