Refactor sync type implementation
This commit is contained in:
parent
ceccdea859
commit
5b9d42cdc0
1 changed files with 10 additions and 9 deletions
|
@ -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 = [];
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue