clan_cli: URI parser now only has HTTP and FILE. Also clan:///home/user or clan://~/Downloads is supported

This commit is contained in:
Qubasa
2023-12-08 13:46:21 +01:00
parent 6f80cdb5eb
commit b8bc7a3fcc
4 changed files with 82 additions and 31 deletions

View File

@@ -82,6 +82,13 @@ def nix_eval(flags: list[str]) -> list[str]:
return default_flags + flags
def nix_metadata(flake: str) -> dict[str, Any]:
cmd = nix_command(["flake", "metadata", "--json", flake])
proc = subprocess.run(cmd, check=True, text=True, stdout=subprocess.PIPE)
data = json.loads(proc.stdout)
return data
@deal.raises(ClanError)
def nix_shell(packages: list[str], cmd: list[str]) -> list[str]:
# we cannot use nix-shell inside the nix sandbox