Merge pull request 'machines update: remove unecessary special handling for non-path flakes' (#2640) from DavHau/clan-core:DavHau-dave into main

This commit is contained in:
clan-bot
2024-12-20 12:29:39 +00:00

View File

@@ -44,14 +44,10 @@ def upload_sources(machine: Machine) -> str:
str(machine.flake.path) if machine.flake.is_local() else machine.flake.url
)
flake_data = nix_metadata(flake_url)
url = flake_data["resolvedUrl"]
has_path_inputs = any(
is_path_input(node) for node in flake_data["locks"]["nodes"].values()
)
if not has_path_inputs and not is_path_input(flake_data):
# No need to upload sources, we can just build the flake url directly
# FIXME: this might fail for private repositories?
return url
if not has_path_inputs:
# Just copy the flake to the remote machine, we can substitute other inputs there.
path = flake_data["path"]