def build_expression( self, expression: str, out_link: Optional[str] = None, arguments: Dict[str, NixOption] = dict(), ) -> None: self.run_nix_command( "nix-build", ["--expr", expression] + (["-o", out_link] if out_link else []) + create_command_options(arguments), )
def build( self, source_file: str, attribute: Optional[str] = None, out_link: Optional[str] = None, arguments: Dict[str, NixOption] = dict(), ) -> None: self.run_nix_command( "nix-build", [source_file] + (["-o", out_link] if out_link else []) + (["-A", attribute] if attribute else []) + create_command_options(arguments), )
def shell( self, command: str, derivation_path: str, nix_arguments: Dict[str, NixOption] = {}, pure: bool = True, ) -> str: output = self.run_nix_command( "nix-shell", create_command_options(nix_arguments) + (["--pure"] if pure else []) + [derivation_path, "--command", command], ) return output