Create dedicated rclone
module
This commit is contained in:
parent
c422b43d5c
commit
6ae1a4a688
40
lib/modules/packages/rclone.nix
Normal file
40
lib/modules/packages/rclone.nix
Normal file
|
@ -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 = {};
|
||||
};
|
||||
};
|
||||
};
|
||||
}));
|
||||
};
|
||||
};
|
||||
}
|
|
@ -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 = {};
|
||||
};
|
||||
};
|
||||
};
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue