Added new type FlakeName

This commit is contained in:
2023-10-14 15:17:58 +02:00
parent 718f647774
commit 6def19b4c8
17 changed files with 97 additions and 72 deletions

View File

@@ -1,9 +1,10 @@
from ..dirs import specific_machine_dir
from ..flakes.types import FlakeName
def machine_has_fact(flake_name: str, machine: str, fact: str) -> bool:
def machine_has_fact(flake_name: FlakeName, machine: str, fact: str) -> bool:
return (specific_machine_dir(flake_name, machine) / "facts" / fact).exists()
def machine_get_fact(flake_name: str, machine: str, fact: str) -> str:
def machine_get_fact(flake_name: FlakeName, machine: str, fact: str) -> str:
return (specific_machine_dir(flake_name, machine) / "facts" / fact).read_text()