diff --git a/lib/modules/packages/rclone.nix b/lib/modules/packages/rclone.nix new file mode 100644 index 00000000..78a02a81 --- /dev/null +++ b/lib/modules/packages/rclone.nix @@ -0,0 +1,40 @@ +{ lib, ... }: + let + inherit (lib) + mkOption + types + ; + + syncType = types.submodule ( + { ... }: { + options = { + dirName = mkOption { + type = types.str; + description = "The name of the directory to sync the remote files to."; + }; + + cacheDuration = mkOption { + type = types.nullOr types.str; + description = "The amount of time to keep cached files."; + default = null; + }; + }; + }); + in { + options = { + valhalla.linux.users = mkOption { + type = types.attrsOf (types.submodule ( + { ... }: { + options = { + rclone = { + configurations = mkOption { + type = types.attrsOf syncType; + description = "The configurations of the rclone mounts."; + default = {}; + }; + }; + }; + })); + }; + }; + } diff --git a/lib/modules/users.nix b/lib/modules/users.nix index f43bbc2c..d969e729 100644 --- a/lib/modules/users.nix +++ b/lib/modules/users.nix @@ -7,22 +7,6 @@ cfg = config.valhalla; capitalize = (import ../text.nix { inherit lib; }).capitalize; - - syncType = types.submodule ( - { ... }: { - options = { - dirName = mkOption { - type = types.str; - description = "The name of the directory to sync the remote files to."; - }; - - cacheDuration = mkOption { - type = types.nullOr types.str; - description = "The amount of time to keep cached files."; - default = null; - }; - }; - }); in { options = { valhalla = { @@ -61,14 +45,6 @@ description = "The default shell of the user."; default = null; }; - - rclone = { - configurations = mkOption { - type = types.attrsOf syncType; - description = "The configurations of the rclone mounts."; - default = {}; - }; - }; }; }); };