From e4f1e144a0c39317433cbe59bab5d157d2a48741 Mon Sep 17 00:00:00 2001 From: Ingolf Wanger Date: Tue, 21 May 2019 22:24:36 +0200 Subject: [PATCH] syncthing: made module more NixOps friendly --- nixos/modules/services/networking/syncthing.nix | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/networking/syncthing.nix b/nixos/modules/services/networking/syncthing.nix index 89dae7bb3f86..d495703fc539 100644 --- a/nixos/modules/services/networking/syncthing.nix +++ b/nixos/modules/services/networking/syncthing.nix @@ -18,7 +18,10 @@ let fsWatcherEnabled = folder.watch; fsWatcherDelayS = folder.watchDelay; ignorePerms = folder.ignorePerms; - }) cfg.declarative.folders; + }) (filterAttrs ( + _: folder: + folder.enable + ) cfg.declarative.folders); # get the api key by parsing the config.xml getApiKey = pkgs.writers.writeDash "getAPIKey" '' @@ -169,6 +172,16 @@ in { type = types.attrsOf (types.submodule ({ config, ... }: { options = { + enable = mkOption { + type = types.bool; + default = true; + description = '' + share this folder. + This option is useful when you want to define all folders + in one place, but not every machine should share all folders. + ''; + }; + path = mkOption { type = types.str; default = config._module.args.name;