aboutsummaryrefslogtreecommitdiff
path: root/home-manager/modules/programs/rtorrent.nix
blob: 6300969a51960c41b6a30af6d919090532d8e4b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{ config, lib, pkgs, ... }:

with lib;

let

  cfg = config.programs.rtorrent;

in

{
  meta.maintainers = [ maintainers.marsam ];

  options.programs.rtorrent = {
    enable = mkEnableOption "rTorrent";

    settings = mkOption {
      type = types.lines;
      default = "";
      description = ''
        Configuration written to
        <filename>~/.config/rtorrent/rtorrent.rc</filename>. See
        <link xlink:href="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.settings != "") {
      text = cfg.settings;
    };
  };
}