-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfly.nix
More file actions
55 lines (53 loc) · 1.06 KB
/
Copy pathfly.nix
File metadata and controls
55 lines (53 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{ lib
, formats
## ===
, appName ? "web163c91d04b1448cabef86f9f"
, internalPort ? 8000
, rustLog ? null
}:
let
flyConfig = {
app = appName;
# deploy.strategy = "immediate";
services = [
{
internal_port = internalPort;
protocol = "tcp";
ports = [
{
handlers = [ "http" ];
port = "80";
}
{
handlers = [ "tls" "http" ];
port = "443";
}
];
http_checks = [
{
grace_period = "1s";
interval = "15s";
timeout = "2s";
path = "/_health";
method = "get";
protocol = "http";
}
];
}
];
env = {
APP_LISTEN_ADDR = "0.0.0.0:${toString internalPort}";
APP_HOST_REDIRECT = "sa.m-h.ug";
APP_STATIC_FILES_DIR = "/www/static";
}
// lib.optionalAttrs (rustLog != null) { RUST_LOG = rustLog; }
;
};
flyToml = (formats.toml { }).generate "fly.toml" flyConfig;
in
{
inherit
flyConfig
flyToml
;
}