depot/third_party/home-manager/modules/programs/rtorrent.nix
Default email 75fa0ae5af Project import generated by Copybara.
GitOrigin-RevId: c3ab5ea047e6dc73df530948f7367455749d8906
2023-08-08 12:19:01 +02:00

40 lines
840 B
Nix

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