1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-18 09:09:45 +01:00
home-manager/modules/programs/rtorrent.nix

41 lines
892 B
Nix
Raw Normal View History

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 {
2019-05-13 08:00:00 +02:00
meta.maintainers = [ maintainers.marsam ];
imports = [
(mkRenamedOptionModule # \
[ "programs" "rtorrent" "settings" ] # \
[ "programs" "rtorrent" "extraConfig" ])
];
2019-05-13 08:00:00 +02:00
options.programs.rtorrent = {
enable = mkEnableOption "rTorrent";
extraConfig = mkOption {
2019-05-13 08:00:00 +02:00
type = types.lines;
default = "";
description = ''
Configuration written to
<filename>$XDG_CONFIG_HOME/rtorrent/rtorrent.rc</filename>. See
2019-05-13 08:00:00 +02: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-02 00:39:17 +01:00
xdg.configFile."rtorrent/rtorrent.rc" =
mkIf (cfg.extraConfig != "") { text = cfg.extraConfig; };
2019-05-13 08:00:00 +02:00
};
}