summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--custom/bar-service.nix32
1 files changed, 32 insertions, 0 deletions
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 {
56 example = "http://localhost:80/thermoprint/api"; 56 example = "http://localhost:80/thermoprint/api";
57 description = "Thermoprint base url"; 57 description = "Thermoprint base url";
58 }; 58 };
59
60 postgresql = {
61 user = mkOption {
62 type = types.str;
63 default = cfg.user;
64 };
65
66 host = mkOption {
67 type = types.str;
68 default = "/tmp";
69 };
70
71 port = mkOption {
72 type = types.int;
73 default = 5432;
74 };
75
76 database = mkOption {
77 type = types.str;
78 default = cfg.user;
79 };
80
81 poolsize = mkOption {
82 type = types.int;
83 default = 10;
84 };
85 };
59 }; 86 };
60 87
61 imports = [ ./thermoprint-service.nix ]; 88 imports = [ ./thermoprint-service.nix ];
@@ -100,6 +127,11 @@ in {
100 APPROOT = cfg.approot; 127 APPROOT = cfg.approot;
101 IP_FROM_HEADER = if cfg.ipFromHeader then "True" else "False"; 128 IP_FROM_HEADER = if cfg.ipFromHeader then "True" else "False";
102 TPRINT_BASEURL = mkIf (cfg.thermoprintBaseURL != null) cfg.thermoprintBaseURL; 129 TPRINT_BASEURL = mkIf (cfg.thermoprintBaseURL != null) cfg.thermoprintBaseURL;
130 PGUSER = cfg.postgresql.user;
131 PGHOST = cfg.postgresql.host;
132 PGPORT = toString cfg.postgresql.port;
133 PGDATABASE = cfg.postgresql.database;
134 PGPOOLSIZE = toString cfg.postgresql.poolsize;
103 }; 135 };
104 136
105 bindsTo = [ "postgresql.service" ]; 137 bindsTo = [ "postgresql.service" ];