From 0366147235fef1c02ae26e21a4a70659d3ffceb8 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 29 Jan 2024 09:49:15 +0100 Subject: [PATCH] clan-cli machines: get flake path via flake metadata --- pkgs/clan-cli/clan_cli/machines/machines.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkgs/clan-cli/clan_cli/machines/machines.py b/pkgs/clan-cli/clan_cli/machines/machines.py index 81e31dc7..54ac651a 100644 --- a/pkgs/clan-cli/clan_cli/machines/machines.py +++ b/pkgs/clan-cli/clan_cli/machines/machines.py @@ -3,7 +3,7 @@ import logging from pathlib import Path from ..cmd import run -from ..nix import nix_build, nix_config, nix_eval +from ..nix import nix_build, nix_config, nix_eval, nix_metadata from ..ssh import Host, parse_deployment_address log = logging.getLogger(__name__) @@ -78,9 +78,7 @@ class Machine: if hasattr(self, "flake_path"): return Path(self.flake_path) - print(nix_eval([f"{self.flake}"])) - print(f"self.flake:{self.flake}. Type: {type(self.flake)}") - self.flake_path = run(nix_eval([f"{self.flake} "])).stdout.strip() + self.flake_path = nix_metadata(self.flake)["path"] return Path(self.flake_path) @property