tasks.py: get hosts from flake
This commit is contained in:
parent
2aeae8abbf
commit
df9aa7a9dd
1 changed files with 9 additions and 1 deletions
10
tasks.py
10
tasks.py
|
@ -119,7 +119,15 @@ def mkdocs(c):
|
||||||
|
|
||||||
def get_hosts(hosts: str) -> List[DeployHost]:
|
def get_hosts(hosts: str) -> List[DeployHost]:
|
||||||
if hosts == "":
|
if hosts == "":
|
||||||
return [DeployHost(f"build{n + 1:02d}.nix-community.org") for n in range(4)]
|
res = subprocess.run(
|
||||||
|
["nix", "flake", "show", "--json", "--all-systems"],
|
||||||
|
check=True,
|
||||||
|
text=True,
|
||||||
|
stdout=subprocess.PIPE,
|
||||||
|
)
|
||||||
|
data = json.loads(res.stdout)
|
||||||
|
systems = data["nixosConfigurations"]
|
||||||
|
return [DeployHost(f"{n}.nix-community.org") for n in systems]
|
||||||
|
|
||||||
return [DeployHost(f"{h}.nix-community.org") for h in hosts.split(",")]
|
return [DeployHost(f"{h}.nix-community.org") for h in hosts.split(",")]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue