[M7] generated flake.nix moves to build/flake.nix

This commit is contained in:
2026-05-15 22:57:05 +00:00
parent db1c9eb36d
commit 815e5b1be2
5 changed files with 22 additions and 10 deletions

View File

@@ -109,7 +109,7 @@ namespace {
auto run_nix_cmake(const fs::path& project_root, const std::vector<std::string>& cmake_args,
std::string_view phase) -> util::Result<void> {
std::vector<std::string> args{"develop", "--command", "cmake"};
std::vector<std::string> args{"develop", "path:./build", "--command", "cmake"};
args.insert(args.end(), cmake_args.begin(), cmake_args.end());
auto r = exec::run("nix", args, exec::ExecOptions{
@@ -233,7 +233,7 @@ auto cmd_build(const fs::path& project_root, bool no_build, bool release,
project_root / "build"));
}
if (auto r = write_text(project_root / "flake.nix", flake_text); !r) {
if (auto r = write_text(project_root / "build" / "flake.nix", flake_text); !r) {
return std::unexpected(r.error());
}
if (auto r = write_text(project_root / "build" / "CMakeLists.txt", cmake_text); !r) {

View File

@@ -19,8 +19,8 @@ auto cmd_test(const fs::path& project_root, bool release,
const auto build_dir = std::format("build/{}", profile);
auto r = exec::run("nix",
{"develop", "--command", "ctest", "--test-dir", build_dir,
"--output-on-failure"},
{"develop", "path:./build", "--command", "ctest",
"--test-dir", build_dir, "--output-on-failure"},
exec::ExecOptions{
.cwd = project_root,
.env_overrides = {},

View File

@@ -115,7 +115,7 @@ auto run(int argc, char** argv) -> int {
return 1;
}
if (build_no_build) {
std::cout << " Generated flake.nix, build/CMakeLists.txt, Cargoxx.lock\n";
std::cout << " Generated build/flake.nix, build/CMakeLists.txt, Cargoxx.lock\n";
} else {
std::cout << " Built\n";
}