rtorrent: add module

This commit is contained in:
Mario Rodas 2019-05-13 01:00:00 -05:00 committed by Robert Helgesson
parent 7205d3b2d2
commit bdb4cf6c59
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
2 changed files with 38 additions and 0 deletions

View file

@ -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 { })

View file

@ -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;
};
};
}