diff --git a/src/libfetchers/git-utils.cc b/src/libfetchers/git-utils.cc index b59bf033d619..430cd91cd3d9 100644 --- a/src/libfetchers/git-utils.cc +++ b/src/libfetchers/git-utils.cc @@ -30,6 +30,8 @@ #include #include +namespace fs = std::filesystem; + namespace std { template<> struct hash @@ -302,18 +304,21 @@ struct GitRepoImpl : GitRepo, std::enable_shared_from_this if (pathExists(modulesFile)) info.submodules = parseSubmodules(modulesFile); + fs::path cwd = fs::current_path(); + + // Usually ignored, so add it manually if (pathExists(path / ".devenv.flake.nix")) { - info.files.insert(CanonPath(".devenv.flake.nix")); - info.files.insert(CanonPath(".devenv/flake.json")); - info.files.insert(CanonPath(".devenv/devenv.json")); + info.files.insert(CanonPath(std::string_view(".devenv.flake.nix"), CanonPath(cwd.string()))); + info.files.insert(CanonPath(std::string_view(".devenv/flake.json"), CanonPath(cwd.string()))); + info.files.insert(CanonPath(std::string_view(".devenv/devenv.json"), CanonPath(cwd.string()))); } if (pathExists(path / "devenv.local.nix")) { - info.files.insert(CanonPath("devenv.local.nix")); + info.files.insert(CanonPath(std::string_view("devenv.local.nix"), CanonPath(cwd.string()))); } // begins with .env if (pathExists(path / ".env")) { - info.files.insert(CanonPath(".env")); + info.files.insert(CanonPath(std::string_view(".env"), CanonPath(cwd.string()))); } return info;