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