fix manyfold
This commit is contained in:
25
modules/apps/mongodb/default.nix
Normal file
25
modules/apps/mongodb/default.nix
Normal file
@@ -0,0 +1,25 @@
|
||||
{ lib, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.nas-apps.mongodb;
|
||||
in
|
||||
{
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
virtualisation.oci-containers.containers."${cfg.name}" = {
|
||||
autoStart = cfg.autoStart;
|
||||
image = cfg.image;
|
||||
ports = [ "${cfg.port}:27017" ];
|
||||
volumes = [ "${cfg.configPath}:/data/db mongodb/" ];
|
||||
# environmentFiles = cfg.environmentFiles;
|
||||
environment = {
|
||||
PUID = cfg.puid;
|
||||
PGID = cfg.pgid;
|
||||
TZ = cfg.timeZone;
|
||||
# MONGO_INITDB_ROOT_USERNAME = "";#cfg.databaseUser;
|
||||
# MONGO_INITDB_ROOT_PASSWORD = "";#cfg.databasePassword; # get from env file
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
52
modules/apps/mongodb/options.nix
Normal file
52
modules/apps/mongodb/options.nix
Normal file
@@ -0,0 +1,52 @@
|
||||
{ lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
options.nas-apps.mongodb = {
|
||||
enable = mkEnableOption "mongodb docker service";
|
||||
|
||||
autoStart = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
|
||||
port = mkOption {
|
||||
type = types.str;
|
||||
default = "27017";
|
||||
};
|
||||
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
default = "mongodb";
|
||||
};
|
||||
|
||||
image = mkOption {
|
||||
type = types.str;
|
||||
default = "mongodb/mongodb-community-server";
|
||||
};
|
||||
|
||||
configPath = mkOption {
|
||||
type = types.str;
|
||||
default = "/media/nas/ssd/mongodb";
|
||||
};
|
||||
|
||||
puid = mkOption {
|
||||
type = types.str;
|
||||
default = "911";
|
||||
};
|
||||
|
||||
pgid = mkOption {
|
||||
type = types.str;
|
||||
default = "1000";
|
||||
};
|
||||
|
||||
timeZone = mkOption {
|
||||
type = types.str;
|
||||
default = "America/Chicago";
|
||||
};
|
||||
|
||||
environmentFiles = mkOption {
|
||||
type = with types; listOf path;
|
||||
default = [ ];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user