mkModule various

This commit is contained in:
mjallen18
2025-12-17 14:11:49 -06:00
parent 96ce0001c5
commit 63bd725d64
16 changed files with 304 additions and 1136 deletions

View File

@@ -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 ];
}