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

@@ -11,6 +11,7 @@ from typing import Any, Optional, Tuple, get_origin
from clan_cli.dirs import machine_settings_file, specific_flake_dir
from clan_cli.errors import ClanError
from clan_cli.flakes.types import FlakeName
from clan_cli.git import commit_file
from clan_cli.nix import nix_eval
@@ -107,7 +108,7 @@ def cast(value: Any, type: Any, opt_description: str) -> Any:
def options_for_machine(
flake_name: str, machine_name: str, show_trace: bool = False
flake_name: FlakeName, machine_name: str, show_trace: bool = False
) -> dict:
clan_dir = specific_flake_dir(flake_name)
flags = []
@@ -130,7 +131,7 @@ def options_for_machine(
def read_machine_option_value(
flake_name: str, machine_name: str, option: str, show_trace: bool = False
flake_name: FlakeName, machine_name: str, option: str, show_trace: bool = False
) -> str:
clan_dir = specific_flake_dir(flake_name)
# use nix eval to read from .#nixosConfigurations.default.config.{option}
@@ -243,7 +244,7 @@ def find_option(
def set_option(
flake_name: str,
flake_name: FlakeName,
option: str,
value: Any,
options: dict,