From df9aa7a9ddd45bf7395295c337d3ae6d7e1b01fb Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Sat, 20 May 2023 09:27:25 +1000 Subject: [PATCH] tasks.py: get hosts from flake --- tasks.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tasks.py b/tasks.py index 4c53b55..4f3830a 100644 --- a/tasks.py +++ b/tasks.py @@ -119,7 +119,15 @@ def mkdocs(c): def get_hosts(hosts: str) -> List[DeployHost]: 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(",")]