-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeps.py
More file actions
43 lines (37 loc) · 853 Bytes
/
deps.py
File metadata and controls
43 lines (37 loc) · 853 Bytes
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
#!/usr/bin/env python3
import os
import subprocess
import pulumi
depNames = [
"azure.archive",
"gcp.image",
"aws.archive",
"aws.adapter-archive",
"alicloud.archive",
]
pulumi.info("Loading nix dependencies...")
nix_env = os.environ.copy()
nix_env["NIXPKGS_ALLOW_UNFREE"] = "1"
drvs = (
subprocess.run(
[
"nix",
"build",
"--impure",
"--print-out-paths",
"--system",
"x86_64-linux",
]
+ sum(
([f"{os.path.dirname(os.path.realpath(__file__))}#{x}"] for x in depNames),
[],
),
env=nix_env,
check=True,
stdout=subprocess.PIPE,
)
.stdout.decode()
.split("\n")
)
nixdeps = {name: drv.strip() for name, drv in zip(depNames, drvs)}
pulumi.info("Dependencies loaded.")