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, ... }:
let
nextcloud = "nextcloud";
proton = "proton";
syncProviders = {
nextcloud = {};
proton = {};
};
syncType = lib.types.submodule (
{ name, ... }: {
{ config, name, ... }: {
options = {
type = lib.mkOption {
type = lib.types.enum [
nextcloud
proton
];
description = "The type of the sync";
type = lib.types.enum (builtins.attrNames syncProviders);
};
autoStart = lib.mkOption {
@ -32,9 +33,9 @@ let
default = {};
};
preLaunch = lib.mkOption {
secretsScript = lib.mkOption {
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 = [];
};
};