more organization, or maybe disorganization...
This commit is contained in:
26
modules/apps/nextcloud/default.nix
Normal file
26
modules/apps/nextcloud/default.nix
Normal file
@@ -0,0 +1,26 @@
|
||||
{ lib, pkgs, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.nas-apps.nextcloud;
|
||||
in {
|
||||
imports = [
|
||||
./options.nix
|
||||
];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
virtualisation.oci-containers.containers."${cfg.name}" = {
|
||||
autoStart = cfg.autoStart;
|
||||
image = cfg.image;
|
||||
ports = [ "${cfg.httpPort}:80" "${cfg.httpsPort}:443" ];
|
||||
volumes = [
|
||||
"${cfg.configPath}:/config"
|
||||
"${cfg.dataPath}:/data"
|
||||
];
|
||||
environment = {
|
||||
PUID = cfg.puid;
|
||||
PGID = cfg.pgid;
|
||||
TZ = cfg.timeZone;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
57
modules/apps/nextcloud/options.nix
Normal file
57
modules/apps/nextcloud/options.nix
Normal file
@@ -0,0 +1,57 @@
|
||||
{ lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
options.nas-apps.nextcloud = {
|
||||
enable = mkEnableOption "nextcloud docker service";
|
||||
|
||||
autoStart = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
|
||||
httpPort = mkOption {
|
||||
type = types.str;
|
||||
default = "80";
|
||||
};
|
||||
|
||||
httpsPort = mkOption {
|
||||
type = types.str;
|
||||
default = "443";
|
||||
};
|
||||
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
default = "nextcloud";
|
||||
};
|
||||
|
||||
image = mkOption {
|
||||
type = types.str;
|
||||
default = "linuxserver/nextcloud";
|
||||
};
|
||||
|
||||
configPath = mkOption {
|
||||
type = types.str;
|
||||
default = "/mnt/ssd/ssd_app_data/nextcloud";
|
||||
};
|
||||
|
||||
dataPath = mkOption {
|
||||
type = types.str;
|
||||
default = "/mnt/mainpool/Nextcloud";
|
||||
};
|
||||
|
||||
puid = mkOption {
|
||||
type = types.str;
|
||||
default = "911";
|
||||
};
|
||||
|
||||
pgid = mkOption {
|
||||
type = types.str;
|
||||
default = "1000";
|
||||
};
|
||||
|
||||
timeZone = mkOption {
|
||||
type = types.str;
|
||||
default = "America/Chicago";
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user