diff options
author | Arseniy Seroka <jagajaga@users.noreply.github.com> | 2015-04-06 18:50:05 +0300 |
---|---|---|
committer | Arseniy Seroka <jagajaga@users.noreply.github.com> | 2015-04-06 18:50:05 +0300 |
commit | e52e16019082081c902844f475a3ff76c1a31393 (patch) | |
tree | cf0602a97a0fd9fb3890e75bbf53de44eaedbde7 /nixos | |
parent | bed68ea21ea090791a247155f689bab9f7a0c6c8 (diff) | |
parent | 0539ed477151a3adfff5012cabff0527a9a8c0bb (diff) | |
download | nixpkgs-e52e16019082081c902844f475a3ff76c1a31393.tar nixpkgs-e52e16019082081c902844f475a3ff76c1a31393.tar.gz nixpkgs-e52e16019082081c902844f475a3ff76c1a31393.tar.bz2 nixpkgs-e52e16019082081c902844f475a3ff76c1a31393.tar.lz nixpkgs-e52e16019082081c902844f475a3ff76c1a31393.tar.xz nixpkgs-e52e16019082081c902844f475a3ff76c1a31393.tar.zst nixpkgs-e52e16019082081c902844f475a3ff76c1a31393.zip |
Merge pull request #7215 from cwoac/btsync2
Add support for btsync 2.x branch
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/networking/btsync.nix | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/nixos/modules/services/networking/btsync.nix b/nixos/modules/services/networking/btsync.nix index 34bddf90873..0bfd3b74348 100644 --- a/nixos/modules/services/networking/btsync.nix +++ b/nixos/modules/services/networking/btsync.nix @@ -4,6 +4,9 @@ with lib; let cfg = config.services.btsync; + + bittorrentSync = cfg.package; + listenAddr = cfg.httpListenAddr + ":" + (toString cfg.httpListenPort); boolStr = x: if x then "true" else "false"; @@ -57,7 +60,7 @@ let '' { "device_name": "${cfg.deviceName}", - "storage_path": "/var/lib/btsync/", + "storage_path": "${cfg.storagePath}", "listening_port": ${toString cfg.listeningPort}, "use_gui": false, @@ -195,6 +198,24 @@ in ''; }; + package = mkOption { + type = types.package; + default = pkgs.bittorrentSync14; + example = literalExample "pkgs.bittorrentSync20"; + description = '' + Branch of bittorrent sync to use. + ''; + }; + + storagePath = mkOption { + type = types.path; + default = "/var/lib/btsync"; + example = "/var/lib/btsync"; + description = '' + Where to store the bittorrent sync files. + ''; + }; + apiKey = mkOption { type = types.str; default = ""; @@ -258,7 +279,7 @@ in users.extraUsers.btsync = { description = "Bittorrent Sync Service user"; - home = "/var/lib/btsync"; + home = cfg.storagePath; createHome = true; uid = config.ids.uids.btsync; group = "btsync"; @@ -292,6 +313,6 @@ in }; }; - environment.systemPackages = [ pkgs.bittorrentSync ]; + environment.systemPackages = [ cfg.package ]; }; } |