mkModule various
This commit is contained in:
@@ -6,29 +6,35 @@
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.${namespace}.services.nextcloud;
|
||||
in
|
||||
{
|
||||
imports = [ ./options.nix ];
|
||||
name = "nextcloud";
|
||||
cfg = config.${namespace}.services.${name};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
virtualisation.oci-containers.containers."${cfg.name}" = {
|
||||
autoStart = cfg.autoStart;
|
||||
image = cfg.image;
|
||||
ports = [
|
||||
"${cfg.port}:443"
|
||||
];
|
||||
volumes = [
|
||||
"${cfg.configPath}:/config"
|
||||
"${cfg.dataPath}:/data"
|
||||
"/run/postgresql:/run/postgresql"
|
||||
];
|
||||
environmentFiles = [ ];
|
||||
environment = {
|
||||
PUID = cfg.puid;
|
||||
PGID = cfg.pgid;
|
||||
TZ = cfg.timeZone;
|
||||
nextcloudConfig = lib.${namespace}.mkModule {
|
||||
inherit config name;
|
||||
description = "nextcloud";
|
||||
options = { };
|
||||
moduleConfig = {
|
||||
virtualisation.oci-containers.containers."${name}" = {
|
||||
autoStart = true;
|
||||
image = "lscr.io/linuxserver/nextcloud";
|
||||
ports = [
|
||||
"${toString cfg.port}:443"
|
||||
];
|
||||
volumes = [
|
||||
"${cfg.configDir}/nextcloud:/config"
|
||||
"${cfg.dataDir}/nextcloud:/data"
|
||||
"/run/postgresql:/run/postgresql"
|
||||
];
|
||||
environmentFiles = [ ];
|
||||
environment = {
|
||||
PUID = cfg.puid;
|
||||
PGID = cfg.pgid;
|
||||
TZ = cfg.timeZone;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = [ nextcloudConfig ];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user