fork/home-manager

git clone https://git.julia.blue/fork/home-manager

Robert HelgessonMerge PR #421575790441

master
840 B40 linesraw
1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6
7  cfg = config.programs.rtorrent;
8
9in {
10  meta.maintainers = [ ];
11
12  imports = [
13    (mkRenamedOptionModule # \
14      [ "programs" "rtorrent" "settings" ] # \
15      [ "programs" "rtorrent" "extraConfig" ])
16  ];
17
18  options.programs.rtorrent = {
19    enable = mkEnableOption "rTorrent";
20
21    extraConfig = mkOption {
22      type = types.lines;
23      default = "";
24      description = ''
25        Configuration written to
26        {file}`$XDG_CONFIG_HOME/rtorrent/rtorrent.rc`. See
27        <https://github.com/rakshasa/rtorrent/wiki/Config-Guide>
28        for explanation about possible values.
29      '';
30    };
31
32  };
33
34  config = mkIf cfg.enable {
35    home.packages = [ pkgs.rtorrent ];
36
37    xdg.configFile."rtorrent/rtorrent.rc" =
38      mkIf (cfg.extraConfig != "") { text = cfg.extraConfig; };
39  };
40}