From 14eed3cadfac291fb1b1cd098847eb8f5574e4e1 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 8 Sep 2018 18:13:29 +0200 Subject: PostgreSQL config --- custom/bar-service.nix | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'custom') diff --git a/custom/bar-service.nix b/custom/bar-service.nix index f355cd15..1f15b015 100644 --- a/custom/bar-service.nix +++ b/custom/bar-service.nix @@ -56,6 +56,33 @@ in { example = "http://localhost:80/thermoprint/api"; description = "Thermoprint base url"; }; + + postgresql = { + user = mkOption { + type = types.str; + default = cfg.user; + }; + + host = mkOption { + type = types.str; + default = "/tmp"; + }; + + port = mkOption { + type = types.int; + default = 5432; + }; + + database = mkOption { + type = types.str; + default = cfg.user; + }; + + poolsize = mkOption { + type = types.int; + default = 10; + }; + }; }; imports = [ ./thermoprint-service.nix ]; @@ -100,6 +127,11 @@ in { APPROOT = cfg.approot; IP_FROM_HEADER = if cfg.ipFromHeader then "True" else "False"; TPRINT_BASEURL = mkIf (cfg.thermoprintBaseURL != null) cfg.thermoprintBaseURL; + PGUSER = cfg.postgresql.user; + PGHOST = cfg.postgresql.host; + PGPORT = toString cfg.postgresql.port; + PGDATABASE = cfg.postgresql.database; + PGPOOLSIZE = toString cfg.postgresql.poolsize; }; bindsTo = [ "postgresql.service" ]; -- cgit v1.2.3