コード例 #1
0
 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),
     )
コード例 #2
0
 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),
     )
コード例 #3
0
 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