2019-05-13 06:00:00 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.programs.rtorrent;
|
|
|
|
|
2020-02-01 23:39:17 +00:00
|
|
|
in {
|
2019-05-13 06:00:00 +00:00
|
|
|
meta.maintainers = [ maintainers.marsam ];
|
|
|
|
|
2022-08-09 04:22:46 +00:00
|
|
|
imports = [
|
|
|
|
(mkRenamedOptionModule # \
|
|
|
|
[ "programs" "rtorrent" "settings" ] # \
|
|
|
|
[ "programs" "rtorrent" "extraConfig" ])
|
|
|
|
];
|
|
|
|
|
2019-05-13 06:00:00 +00:00
|
|
|
options.programs.rtorrent = {
|
|
|
|
enable = mkEnableOption "rTorrent";
|
|
|
|
|
2022-08-09 04:22:46 +00:00
|
|
|
extraConfig = mkOption {
|
2019-05-13 06:00:00 +00:00
|
|
|
type = types.lines;
|
|
|
|
default = "";
|
|
|
|
description = ''
|
|
|
|
Configuration written to
|
2021-12-09 03:02:00 +00:00
|
|
|
<filename>$XDG_CONFIG_HOME/rtorrent/rtorrent.rc</filename>. See
|
2019-05-13 06:00:00 +00:00
|
|
|
<link xlink:href="https://github.com/rakshasa/rtorrent/wiki/Config-Guide" />
|
|
|
|
for explanation about possible values.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
home.packages = [ pkgs.rtorrent ];
|
|
|
|
|
2020-02-01 23:39:17 +00:00
|
|
|
xdg.configFile."rtorrent/rtorrent.rc" =
|
2022-08-09 04:22:46 +00:00
|
|
|
mkIf (cfg.extraConfig != "") { text = cfg.extraConfig; };
|
2019-05-13 06:00:00 +00:00
|
|
|
};
|
|
|
|
}
|