clan-cli: Remove unecessary nix_options args from functions

This commit is contained in:
Qubasa
2025-06-24 19:07:41 +02:00
parent 1bec31b371
commit 60d2837ddd
5 changed files with 11 additions and 45 deletions

View File

@@ -162,14 +162,11 @@ class Machine:
def nix(
self,
attr: str,
nix_options: list[str] | None = None,
) -> Any:
"""
Build the machine and return the path to the result
accepts a secret store and a facts store # TODO
"""
if nix_options is None:
nix_options = []
config = nix_config()
system = config["system"]
@@ -178,12 +175,7 @@ class Machine:
f'clanInternals.machines."{system}"."{self.name}".{attr}'
)
def eval_nix(
self,
attr: str,
extra_config: None | dict = None,
nix_options: list[str] | None = None,
) -> Any:
def eval_nix(self, attr: str, extra_config: None | dict = None) -> Any:
"""
eval a nix attribute of the machine
@attr: the attribute to get
@@ -192,17 +184,9 @@ class Machine:
if extra_config:
log.warning("extra_config in eval_nix is no longer supported")
if nix_options is None:
nix_options = []
return self.nix(attr)
return self.nix(attr, nix_options)
def build_nix(
self,
attr: str,
extra_config: None | dict = None,
nix_options: list[str] | None = None,
) -> Path:
def build_nix(self, attr: str, extra_config: None | dict = None) -> Path:
"""
build a nix attribute of the machine
@attr: the attribute to get
@@ -211,10 +195,7 @@ class Machine:
if extra_config:
log.warning("extra_config in build_nix is no longer supported")
if nix_options is None:
nix_options = []
output = self.nix(attr, nix_options)
output = self.nix(attr)
output = Path(output)
if tmp_store := nix_test_store():
output = tmp_store.joinpath(*output.parts[1:])