aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/gc-store.cc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2022-03-10 17:03:16 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2022-03-10 17:10:15 +0000
commite5c42bba9bf76d00fb15ec9a179bf91aa81c38c6 (patch)
tree7597549f36313859d15cb4ae80c04af955c9a223 /src/libstore/gc-store.cc
parent1ef88da3503b88f289a15786dfd48821cf5b6502 (diff)
parent4d98143914120d0163f5c50f30ce8a5289433f8f (diff)
Merge remote-tracking branch 'upstream/master' into indexed-store-path-outputs
Diffstat (limited to 'src/libstore/gc-store.cc')
-rw-r--r--src/libstore/gc-store.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libstore/gc-store.cc b/src/libstore/gc-store.cc
new file mode 100644
index 000000000..3dbdec53b
--- /dev/null
+++ b/src/libstore/gc-store.cc
@@ -0,0 +1,13 @@
+#include "gc-store.hh"
+
+namespace nix {
+
+GcStore & requireGcStore(Store & store)
+{
+ auto * gcStore = dynamic_cast<GcStore *>(&store);
+ if (!gcStore)
+ throw UsageError("Garbage collection not supported by this store");
+ return *gcStore;
+}
+
+}