aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Rodas <marsam@users.noreply.github.com>2019-05-13 01:00:00 -0500
committerRobert Helgesson <robert@rycee.net>2019-09-26 23:42:52 +0200
commitbdb4cf6c59b262c39b77a1d296116817b7631b42 (patch)
treeab486c09b1e3074d4dadbaa1fb8652d34636a2f4
parent7205d3b2d2192b6f0d3fe54a4cf38525ec4e27f5 (diff)
rtorrent: add module
-rw-r--r--modules/modules.nix1
-rw-r--r--modules/programs/rtorrent.nix37
2 files changed, 38 insertions, 0 deletions
diff --git a/modules/modules.nix b/modules/modules.nix
index f2f54f4e1e8..2dc89ebc012 100644
--- a/modules/modules.nix
+++ b/modules/modules.nix
@@ -84,6 +84,7 @@ let
(loadModule ./programs/opam.nix { })
(loadModule ./programs/pidgin.nix { })
(loadModule ./programs/rofi.nix { })
+ (loadModule ./programs/rtorrent.nix { })
(loadModule ./programs/skim.nix { })
(loadModule ./programs/starship.nix { })
(loadModule ./programs/ssh.nix { })
diff --git a/modules/programs/rtorrent.nix b/modules/programs/rtorrent.nix
new file mode 100644
index 00000000000..6300969a519
--- /dev/null
+++ b/modules/programs/rtorrent.nix
@@ -0,0 +1,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;
+ };
+ };
+}