diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc index 96e891f87..2e2e8507b 100644 --- a/src/libstore/gc.cc +++ b/src/libstore/gc.cc @@ -328,6 +328,12 @@ static void findRoots(StoreAPI & store, const Path & path, Roots & roots) } } + else if (S_ISREG(st.st_mode)) { + Path storePath = settings.nixStore + "/" + baseNameOf(path); + if (store.isValidPath(storePath)) + roots[path] = storePath; + } + } catch (SysError & e) {