PortValhalla/lib/modules/programs/nextcloud.nix

59 lines
1.2 KiB
Nix
Raw Permalink Normal View History

{ lib, ... }:
2024-10-06 19:25:34 +00:00
let
inherit (lib) mkEnableOption mkOption types;
2024-10-06 19:25:34 +00:00
syncType = types.submodule ({ ... }: {
options = {
remotePath = mkOption {
type = types.str;
description = "The path to the folder on the cloud to sync.";
};
2024-10-06 19:25:34 +00:00
localPath = mkOption {
type = types.str;
description = "The path to sync the cloud content to.";
};
2024-10-06 19:25:34 +00:00
virtualFiles = (mkEnableOption "virtual file support") // {
default = true;
};
};
});
commonOptions = {
enable = mkEnableOption "Nextcloud client";
};
userOptions = {
folderSyncs = mkOption {
type = types.listOf syncType;
description = "The folders to synchronize";
default = [ ];
};
};
2024-10-06 19:25:34 +00:00
in {
options = {
valhalla = {
programs.nextcloud = commonOptions;
users = mkOption {
type = types.attrsOf (types.submodule (
{ ... }: {
options = {
programs.nextcloud = commonOptions;
};
}));
};
windows.users = mkOption {
type = types.attrsOf (types.submodule (
{ ... }: {
options = {
programs.nextcloud = userOptions;
};
}));
};
};
2024-10-06 19:25:34 +00:00
};
}