diff options
author | makefu <github@syntax-fehler.de> | 2017-09-06 11:12:24 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2017-09-06 11:12:24 +0200 |
commit | 4399e8ee64864596d1a5062a78cf405e2c5d6221 (patch) | |
tree | 0bcc67e7d0f4ff22ca7e4840608f72015a49fbdd /krebs/3modules/rtorrent.nix | |
parent | d12b4d86310ab56ac87f4ba768e49fd6423a9f37 (diff) | |
parent | 99ecdb4dab32d5a5044cd439a9ce639801d1398b (diff) |
Merge remote-tracking branch 'lass/master'
Diffstat (limited to 'krebs/3modules/rtorrent.nix')
-rw-r--r-- | krebs/3modules/rtorrent.nix | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/krebs/3modules/rtorrent.nix b/krebs/3modules/rtorrent.nix index d85518993..472accef9 100644 --- a/krebs/3modules/rtorrent.nix +++ b/krebs/3modules/rtorrent.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, options, ... }: with import <stockholm/lib>; let @@ -73,6 +73,15 @@ let # authentication also applies to rtorrent.rutorrent enable = mkEnableOption "rtorrent nginx web RPC"; + addr = mkOption { + type = types.addr4; + default = "0.0.0.0"; + description = '' + the address to listen on + default is 0.0.0.0 + ''; + }; + port = mkOption { type = types.nullOr types.int; description ='' @@ -290,7 +299,7 @@ let services.nginx.enable = mkDefault true; services.nginx.virtualHosts.rtorrent = { default = mkDefault true; - inherit (webcfg) basicAuth port; + inherit (webcfg) basicAuth; root = optionalString rucfg.enable webdir; locations = { @@ -310,7 +319,15 @@ let include ${pkgs.nginx}/conf/fastcgi.conf; ''; } ); - }; + # workaround because upstream nginx api changed + # TODO remove when nobody uses 17.03 anymore + } // (if hasAttr "port" (head options.services.nginx.virtualHosts.type.getSubModules).submodule.options then { + port = webcfg.port; + } else { + listen = [ + { inherit (webcfg) addr port; } + ]; + }); }; rutorrent-imp = { |