Files
spacestation/modules/medama.nix

39 lines
824 B
Nix
Raw Normal View History

2025-04-04 20:11:53 -03:00
{
config,
lib,
...
}:
with lib; let
cfg = config.services.medama;
in {
imports = [];
options.services.medama = {
enable = mkEnableOption "";
ssl = mkEnableOption "";
port = mkOption {
type = with types; port;
default = 8080;
};
cors = mkOption {
type = with types; listOf str;
default = [];
apply = v: concatStringsSep "," v;
};
2025-04-04 20:11:53 -03:00
};
config = mkIf cfg.enable {
virtualisation.oci-containers.containers.medama = {
image = "ghcr.io/medama-io/medama:v0.5.2";
autoStart = true;
2025-04-04 20:13:16 -03:00
extraOptions = ["--network=host"];
2025-04-04 20:11:53 -03:00
volumes = [
"/var/lib/medama/data:/app/data"
];
environment = {
AUTO_SLL = toString cfg.ssl;
2025-04-04 20:13:16 -03:00
PORT = toString cfg.port;
CORS_ALLOWED_ORIGINS = cfg.cors;
2025-04-04 20:11:53 -03:00
};
};
};
}