nixos-module: add redis settings

This commit is contained in:
Astro 2023-10-12 22:43:46 +02:00
parent a8461c7217
commit 0dd28356b6

View file

@ -37,6 +37,21 @@
type = types.enum [ "ERROR" "WARN" "INFO" "DEBUG" "TRACE" ]; type = types.enum [ "ERROR" "WARN" "INFO" "DEBUG" "TRACE" ];
default = "INFO"; default = "INFO";
}; };
redis = {
connection = mkOption {
type = with types; nullOr str;
default = null;
};
passwordFile = mkOption {
type = with types; nullOr path;
default = null;
};
in_topic = mkOption {
type = with types; nullOr str;
default = null;
};
};
}; };
config = config =
@ -50,6 +65,9 @@
priv_key_file = cfg.privKeyFile; priv_key_file = cfg.privKeyFile;
pub_key_file = cfg.pubKeyFile; pub_key_file = cfg.pubKeyFile;
db = "host=/var/run/postgresql user=${cfg.user} dbname=${cfg.database}"; db = "host=/var/run/postgresql user=${cfg.user} dbname=${cfg.database}";
redis = if cfg.redis.connection != null
then cfg.redis
else null;
}); });
inherit (self.packages.${pkgs.system}) buzzrelay; inherit (self.packages.${pkgs.system}) buzzrelay;
in in