test redis

This commit is contained in:
mjallen18
2024-07-22 10:20:12 -05:00
parent 42795b6e10
commit b2ffed3095
5 changed files with 57 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
{
lib,
pkgs,
config,
...
}:
with lib;
let
cfg = config.nas-apps.redis;
in
{
imports = [ ./options.nix ];
config = mkIf cfg.enable {
virtualisation.oci-containers.containers."${cfg.name}" = {
autoStart = cfg.autoStart;
image = cfg.image;
cmd = cfg.cmd;
ports = [
"6379:6379"
];
};
};
}

View File

@@ -0,0 +1,27 @@
{ lib, ... }:
with lib;
{
options.nas-apps.redis = {
enable = mkEnableOption "redis docker service";
autoStart = mkOption {
type = types.bool;
default = true;
};
name = mkOption {
type = types.str;
default = "redis";
};
image = mkOption {
type = types.str;
default = "redis";
};
cmd = mkOption {
type = types.str;
default = "redis-server --requirepass BogieDudie1";
};
};
}