Skip to content

Commit c3ce81b

Browse files
authored
build: generates vit-ss config file in container (#175)
2 parents 2c10dba + ebde772 commit c3ce81b

File tree

1 file changed

+40
-5
lines changed

1 file changed

+40
-5
lines changed

nix/vit-servicing-station/operables.nix

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,54 @@
1010
package = cell.packages.vit-servicing-station-server;
1111

1212
mkVitOperable = namespace: let
13+
# Deployment artifacts, including block0
1314
artifacts' = artifacts."artifacts-${namespace}";
15+
16+
# Configuration file contents
17+
config = l.toJSON {
18+
tls = {
19+
cert_file = null;
20+
priv_key_file = null;
21+
};
22+
cors = {
23+
max_age_secs = null;
24+
allowed_origins = [
25+
"https://${namespace}-servicing-station.vit.iohk.io"
26+
"http://127.0.0.1"
27+
];
28+
};
29+
block0_path = "${artifacts'}/block0.bin";
30+
enable_api_tokens = false;
31+
log = {
32+
log_level = "trace";
33+
};
34+
address = "0.0.0.0:8080";
35+
service_version = "";
36+
};
1437
in
1538
std.lib.ops.mkOperable {
1639
inherit package;
1740
runtimeInputs = [
1841
artifacts'
1942
];
20-
runtimeScript = std.lib.ops.mkOperableScript {
21-
inherit package;
22-
args = {
23-
"--in-settings-file" = "/local/station-config.json";
43+
runtimeScript = let
44+
configFile =
45+
nixpkgs.runCommand "vit-ss-config-${namespace}"
46+
{
47+
inherit config;
48+
passAsFile = ["config"];
49+
}
50+
''
51+
cp $configPath $out
52+
'';
53+
in
54+
std.lib.ops.mkOperableScript {
55+
inherit package;
56+
args = {
57+
"--in-settings-file" = configFile;
58+
"--service-version" = "3.4";
59+
};
2460
};
25-
};
2661
};
2762
in
2863
{}

0 commit comments

Comments
 (0)