···
description = "Database user.";
37
+
url = lib.mkOption {
38
+
type = lib.types.str;
39
+
default = "postgres://${config.services.windmill.database.name}?host=/var/run/postgresql";
40
+
defaultText = lib.literalExpression ''
41
+
"postgres://\$\{config.services.windmill.database.name}?host=/var/run/postgresql";
43
+
description = "Database url. Note that any secret here would be world-readable. Use `services.windmill.database.urlPath` unstead to include secrets in the url.";
38
-
type = lib.types.path;
47
+
type = lib.types.nullOr lib.types.path;
Path to the file containing the database url windmill should connect to. This is not deducted from database user and name as it might contain a secret
example = "config.age.secrets.DATABASE_URL_FILE.path";
createLocally = lib.mkOption {
···
64
+
default = "https://localhost:${toString config.services.windmill.serverPort}";
65
+
defaultText = lib.literalExpression ''
66
+
"https://localhost:\$\{toString config.services.windmill.serverPort}";
The base url that windmill will be served on.
···
97
+
useUrlPath = (cfg.database.urlPath != null);
# using the same user to simplify db connection
···
ExecStart = "${pkgs.windmill}/bin/windmill";
105
+
} // lib.optionalAttrs useUrlPath {
"DATABASE_URL_FILE:${cfg.database.urlPath}"
110
+
db_url_envs = lib.optionalAttrs useUrlPath {
111
+
DATABASE_URL_FILE = "%d/DATABASE_URL_FILE";
112
+
} // lib.optionalAttrs (!useUrlPath) {
113
+
DATABASE_URL = cfg.database.url;
···
serviceConfig = serviceConfig // { StateDirectory = "windmill";};
135
-
DATABASE_URL_FILE = "%d/DATABASE_URL_FILE";
PORT = builtins.toString cfg.serverPort;
WM_BASE_URL = cfg.baseUrl;
···
serviceConfig = serviceConfig // { StateDirectory = "windmill-worker";};
151
-
DATABASE_URL_FILE = "%d/DATABASE_URL_FILE";
WM_BASE_URL = cfg.baseUrl;
WORKER_GROUP = "default";
windmill-worker-native = {
···
serviceConfig = serviceConfig // { StateDirectory = "windmill-worker-native";};
168
-
DATABASE_URL_FILE = "%d/DATABASE_URL_FILE";
WM_BASE_URL = cfg.baseUrl;