Files
nix/modules/server/nextcloud.nix

64 lines
1.3 KiB
Nix
Raw Normal View History

2024-02-12 14:58:06 -03:00
{
config,
lib,
pkgs,
...
}: let
cfg = config.server.nextcloud;
in {
imports = [];
options.server.nextcloud = with lib;
with lib.types; {
2024-02-12 14:58:06 -03:00
enable = mkEnableOption "";
2024-02-12 14:58:40 -03:00
user = mkOption {
type = str;
default = "nextcloud";
};
2024-02-12 14:58:06 -03:00
package = mkOption {
type = package;
default = pkgs.nextcloud28;
};
domain = mkOption {
type = str;
2024-03-03 11:32:07 -03:00
default = "nextcloud." + config.server.domain;
2024-02-12 14:58:06 -03:00
};
port = mkOption {
type = port;
default = 3030;
};
data = {
root = mkOption {
type = path;
2024-03-03 11:32:07 -03:00
default = config.server.storage + /nextcloud;
2024-02-12 14:58:06 -03:00
};
};
configureRedis = mkOption {
type = bool;
2024-02-12 14:58:40 -03:00
default = false;
};
settings = {
admin.user = mkOption {
type = str;
default = cfg.user;
};
admin.passwordFile = mkOption {
type = path;
};
2024-02-12 14:58:06 -03:00
};
};
config = lib.mkIf cfg.enable {
services.nextcloud = {
2024-02-12 14:58:40 -03:00
config = {
adminuser = cfg.settings.admin.user;
adminpassFile = toString cfg.settings.admin.passwordFile;
};
2024-02-12 14:58:06 -03:00
configureRedis = cfg.configureRedis;
enable = true;
2024-02-12 14:58:40 -03:00
home = toString cfg.data.root;
2024-02-12 14:58:06 -03:00
hostName = cfg.domain;
https = true;
2024-02-12 14:58:40 -03:00
package = cfg.package;
2024-02-12 14:58:06 -03:00
};
};
}