Refactor sync type implementation

This commit is contained in:
Manuel Thalmann 2024-05-14 14:23:30 +02:00
parent ceccdea859
commit 5b9d42cdc0

View file

@ -1,15 +1,16 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
nextcloud = "nextcloud"; syncProviders = {
proton = "proton"; nextcloud = {};
proton = {};
};
syncType = lib.types.submodule ( syncType = lib.types.submodule (
{ name, ... }: { { config, name, ... }: {
options = { options = {
type = lib.mkOption { type = lib.mkOption {
type = lib.types.enum [ description = "The type of the sync";
nextcloud type = lib.types.enum (builtins.attrNames syncProviders);
proton
];
}; };
autoStart = lib.mkOption { autoStart = lib.mkOption {
@ -32,9 +33,9 @@ let
default = {}; default = {};
}; };
preLaunch = lib.mkOption { secretsScript = lib.mkOption {
type = lib.types.lines; type = lib.types.lines;
description = "A set of statements to run before launching the sync."; description = "A script for loading secrets before launching the sync.";
default = []; default = [];
}; };
}; };