clan-lib: Move nix_options from Machine class to Flake class

This commit is contained in:
Qubasa
2025-06-23 13:46:10 +02:00
parent d3d2cb8723
commit d14a5d34fd
11 changed files with 57 additions and 54 deletions

View File

@@ -2,7 +2,7 @@ import argparse
import logging
import shlex
from clan_cli import create_parser
from clan_cli import create_flake_from_args, create_parser
from clan_lib.custom_logger import print_trace
log = logging.getLogger(__name__)
@@ -13,6 +13,10 @@ def run(args: list[str]) -> argparse.Namespace:
parsed = parser.parse_args(args)
cmd = shlex.join(["clan", *args])
# Convert flake path to Flake object with nix_options if flake argument exists
if hasattr(parsed, "flake") and parsed.flake is not None:
parsed.flake = create_flake_from_args(parsed)
print_trace(f"$ {cmd}", log, "localhost")
if hasattr(parsed, "func"):
parsed.func(parsed)