summaryrefslogtreecommitdiff
path: root/custom
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2018-09-08 18:13:29 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2018-09-08 18:13:29 +0200
commit14eed3cadfac291fb1b1cd098847eb8f5574e4e1 (patch)
treea5c4e813592cea27e1716db3e3288cfcc44b7747 /custom
parent40cb08e871296817225c6efb7b1fed22329cde0d (diff)
downloadnixos-14eed3cadfac291fb1b1cd098847eb8f5574e4e1.tar
nixos-14eed3cadfac291fb1b1cd098847eb8f5574e4e1.tar.gz
nixos-14eed3cadfac291fb1b1cd098847eb8f5574e4e1.tar.bz2
nixos-14eed3cadfac291fb1b1cd098847eb8f5574e4e1.tar.xz
nixos-14eed3cadfac291fb1b1cd098847eb8f5574e4e1.zip
PostgreSQL config
Diffstat (limited to 'custom')
-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" ];