This commit is contained in:
mjallen18
2024-07-02 10:40:19 -05:00
parent cb26d2646d
commit 7cc0a882db
4 changed files with 101 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
{
lib,
pkgs,
config,
...
}:
with lib;
let
cfg = config.nas-apps.mealie;
in
{
imports = [ ./options.nix ];
config = mkIf cfg.enable {
virtualisation.oci-containers.containers."${cfg.name}" = {
autoStart = cfg.autoStart;
image = cfg.image;
ports = [ "${cfg.port}:9000" ];
volumes = [
"${cfg.dataPath}:/app/data"
];
environment = {
PUID = cfg.puid;
PGID = cfg.pgid;
TZ = cfg.timeZone;
ALLOW_SIGNUP = cfg.allowSignup;
MAX_WORKERS = cfg.maxWorkers;
MAX_CONCURRENCY = cfg.maxConcurrency;
BASE_URL = cfg.baseUrl;
};
};
};
}

View File

@@ -0,0 +1,62 @@
{ lib, ... }:
with lib;
{
options.nas-apps.mealie = {
enable = mkEnableOption "mealie docker service";
autoStart = mkOption {
type = types.bool;
default = true;
};
port = mkOption {
type = types.str;
default = "9000";
};
name = mkOption {
type = types.str;
default = "mealie";
};
image = mkOption {
type = types.str;
default = "ghcr.io/mealie-recipes/mealie";
};
dataPath = mkOption {
type = types.str;
default = "/media/nas/ssd/nix-app-data/mealie";
};
puid = mkOption {
type = types.str;
default = "911";
};
pgid = mkOption {
type = types.str;
default = "1000";
};
timeZone = mkOption {
type = types.str;
default = "America/Chicago";
};
maxWorkers = mkOption {
type = types.str;
default = "1";
};
maxConcurrency = mkOption {
type = types.str;
default = "1";
};
baseUrl = mkOption {
type = types.str;
default = "";
};
};
}