rclone: ensure remotes have a type field

This commit is contained in:
Jess 2025-03-23 12:33:23 +13:00 committed by Austin Horstman
parent 7a08b8c898
commit 7853236fae
3 changed files with 34 additions and 1 deletions

View file

@ -17,7 +17,16 @@ in {
options = {
config = lib.mkOption {
type = with lib.types;
attrsOf (nullOr (oneOf [ bool int float str ]));
let
baseType = attrsOf (nullOr (oneOf [ bool int float str ]));
# Should we verify whether type constitutes a valid remote?
remoteConfigType = addCheck baseType (lib.hasAttr "type") // {
name = "rcloneRemoteConfig";
description =
"An attribute set containing a remote type and options.";
};
in remoteConfigType;
default = { };
description = ''
Regular configuration options as described in rclone's documentation