Files
manifests/apps/openfga.nix
T

71 lines
1.6 KiB
Nix

{ lib, config, charts, ... }:
let
cfg = config.services.openfga;
namespace = "openfga";
env = "prod";
project = "aux";
cluster = "https://kubernetes.default.svc";
values = lib.attrsets.recursiveUpdate {} cfg.values;
in
{
options.services.openfga = {
enable = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Enable";
};
autoSync = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Auto sync";
};
prune = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Prune";
};
values = lib.mkOption {
type = lib.types.attrsOf lib.types.anything;
default = {};
};
};
config = lib.mkIf cfg.enable {
applications.openfga = {
inherit namespace;
inherit project;
name = "${env}-openfga";
destination.server = cluster;
helm.releases.openfga = {
inherit values;
chart = lib.helm.downloadHelmChart {
repo = "https://openfga.github.io/helm-charts";
chart = "openfga";
version = "0.2.12";
chartHash = "sha256-7yLcw9/oNPvCePrtTJwKAG88t0Ym5Dl/S83Gz+gQdDU=";
};
};
annotations = {
"argocd.argoproj.io/compare-options" = "ServerSideDiff=true";
};
syncPolicy = {
syncOptions = {
applyOutOfSyncOnly = true;
};
autoSync = lib.mkIf cfg.autoSync {
prune = cfg.prune;
selfHeal = false;
};
};
resources = {};
};
};
}