1
1
Fork 0

syncthings: allow for multiple option instances

This commit is contained in:
Tim Van Baak 2024-02-07 05:38:03 +00:00
parent 451d4da000
commit 92b3d5c56e
1 changed files with 422 additions and 414 deletions

View File

@ -3,8 +3,8 @@
with lib; with lib;
let let
cfg = config.services.syncthing; cfg = config.services.syncthings;
opt = options.services.syncthing; opt = options.services.syncthings;
defaultUser = "syncthing"; defaultUser = "syncthing";
defaultGroup = defaultUser; defaultGroup = defaultUser;
settingsFormat = pkgs.formats.json { }; settingsFormat = pkgs.formats.json { };
@ -145,7 +145,12 @@ let
in { in {
###### interface ###### interface
options = { options = {
services.syncthing = { services.syncthings = {
instances = mkOption {
description = mdDoc "Syncthing instance definitions";
default = {};
type = types.attrsOf (types.submodule {
options = {
enable = mkEnableOption enable = mkEnableOption
(lib.mdDoc "Syncthing, a self-hosted open-source alternative to Dropbox and Bittorrent Sync"); (lib.mdDoc "Syncthing, a self-hosted open-source alternative to Dropbox and Bittorrent Sync");
@ -601,6 +606,9 @@ in {
''; '';
}; };
}; };
});
};
};
}; };
###### implementation ###### implementation