diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,16 @@
 
 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
 
+## 0.3.4.0 - 2023-06-28
+
+### Added
+
+ - Nix 2.16 support
+
+ - Nix 2.15 support
+
+ - `getUseSQLiteWAL` low level function. (Use of Nix sqlite files is not recommended)
+
 ## 0.3.3.5 - 2023-03-06
 
 ### Added
diff --git a/hercules-ci-cnix-store.cabal b/hercules-ci-cnix-store.cabal
--- a/hercules-ci-cnix-store.cabal
+++ b/hercules-ci-cnix-store.cabal
@@ -1,7 +1,7 @@
 cabal-version: 2.4
 
 name:           hercules-ci-cnix-store
-version:        0.3.3.5
+version:        0.3.4.0
 synopsis:       Haskell bindings for Nix's libstore
 category:       Nix
 homepage:       https://docs.hercules-ci.com
@@ -24,14 +24,24 @@
   description: Build for Nix >=2.4pre*
   default: True
 
-flag nix-2_5
-  description: Build for Nix >=2.5pre*
-  default: True
+flag nix-2_15
+  description: Build for Nix >=2.15.0
+  default: False
 
+flag ide
+  description: Whether to enable IDE workarounds. You shouldn't need this.
+  default: False
+
 -- match the C++ language standard Nix is using
 common cxx-opts
+  if flag(nix-2_15)
+    cxx-options:
+      -std=c++2a
+  else
+    cxx-options:
+      -std=c++17
+
   cxx-options:
-    -std=c++17
     -Wall
   extra-libraries: stdc++
 
@@ -41,9 +51,15 @@
 
   if impl(ghc >= 8.10)
     ghc-options:
-      -optcxx-std=c++17
       -optcxx-Wall
+    if flag(nix-2_15)
+      ghc-options:
+        -optcxx-std=c++2a
+    else
+      ghc-options:
+        -optcxx-std=c++17
   else
+    -- Remove soon
     ghc-options:
       -optc-std=c++17
       -optc-Wall
@@ -76,8 +92,8 @@
   include-dirs:
       include
   pkgconfig-depends:
-      nix-store >= 2.4 && < 2.15
-    , nix-main >= 2.4 && < 2.15
+      nix-store >= 2.4 && < 2.17
+    , nix-main >= 2.4 && < 2.17
   install-includes:
       hercules-ci-cnix/store.hxx
   hs-source-dirs: src
@@ -93,7 +109,8 @@
     , unix
     , unliftio-core
     , vector
-  extra-libraries:
+  if ! flag(ide)
+    extra-libraries:
       boost_context
   default-language: Haskell2010
   default-extensions: DeriveGeneric DeriveTraversable DisambiguateRecordFields FlexibleContexts InstanceSigs LambdaCase MultiParamTypeClasses NoImplicitPrelude OverloadedStrings RankNTypes TupleSections TypeApplications TypeOperators
@@ -106,7 +123,7 @@
     -fwarn-name-shadowing
     -fwarn-incomplete-patterns
 
-test-suite hercules-ci-cnix-store-tests
+test-suite hercules-ci-cnix-store-unit-tests
   type: exitcode-stdio-1.0
   main-is: TestMain.hs
   other-modules:
@@ -114,6 +131,7 @@
       Hercules.CNix.Std.SetSpec
       Hercules.CNix.Store.DerivationSpec
       Hercules.CNix.Store.TestUtil
+      Hercules.CNix.SettingsSpec
       Hercules.CNix.VerbositySpec
   hs-source-dirs:
       test
diff --git a/src/Hercules/CNix/Settings.hs b/src/Hercules/CNix/Settings.hs
--- a/src/Hercules/CNix/Settings.hs
+++ b/src/Hercules/CNix/Settings.hs
@@ -11,11 +11,14 @@
     getTrustedPublicKeys,
     getNarinfoCacheNegativeTtl,
     getNetrcFile,
+    getUseSQLiteWAL,
+    setUseSQLiteWAL,
   )
 where
 
 import Data.ByteString.Unsafe (unsafePackMallocCString)
 import qualified Data.Set as S
+import Foreign (fromBool, toBool)
 import Hercules.CNix.Encapsulation (moveToForeignPtrWrapper)
 import qualified Hercules.CNix.Std.Set as Std.Set
 import qualified Hercules.CNix.Std.String as Std.String
@@ -106,3 +109,14 @@
     =<< [C.exp| const char *{
       strdup(nix::settings.netrcFile.get().c_str())
     }|]
+
+-- Gets the value of https://nixos.org/manual/nix/stable/command-ref/conf-file.html?highlight=use-sqlite-wal#conf-use-sqlite-wal
+getUseSQLiteWAL :: IO Bool
+getUseSQLiteWAL = do
+  [C.exp| bool { nix::settings.useSQLiteWAL }|] <&> toBool
+
+-- Sets the value of https://nixos.org/manual/nix/stable/command-ref/conf-file.html?highlight=use-sqlite-wal#conf-use-sqlite-wal
+setUseSQLiteWAL :: Bool -> IO ()
+setUseSQLiteWAL value = do
+  let v = fromBool value
+  [C.block| void { nix::settings.useSQLiteWAL = $(bool v); }|]
diff --git a/src/Hercules/CNix/Store.hs b/src/Hercules/CNix/Store.hs
--- a/src/Hercules/CNix/Store.hs
+++ b/src/Hercules/CNix/Store.hs
@@ -463,6 +463,27 @@
                       [&](DerivationOutputCAFixed dof) -> void {
                         typ = 1;
                         path = new StorePath(dof.path(store, $fptr-ptr:(Derivation *derivation)->name, nameString));
+#if NIX_IS_AT_LEAST(2, 16, 0)
+                        std::visit(overloaded {
+                          [&](nix::FileIngestionMethod fim_) -> void {
+                            switch (fim_) {
+                              case nix::FileIngestionMethod::Flat:
+                                fim = 0;
+                                break;
+                              case nix::FileIngestionMethod::Recursive:
+                                fim = 1;
+                                break;
+                              default:
+                                fim = -1;
+                                break;
+                            }
+                          },
+                          [&](nix::TextIngestionMethod) -> void {
+                            // FIXME (RFC 92)
+                            fim = -1;
+                          }
+                        }, dof.ca.getMethod().raw);
+#else
                         switch (dof.hash.method) {
                           case nix::FileIngestionMethod::Flat:
                             fim = 0;
@@ -474,7 +495,14 @@
                             fim = -1;
                             break;
                         }
-                        switch (dof.hash.hash.type) {
+#endif
+
+#if NIX_IS_AT_LEAST(2, 16, 0)
+                        const Hash & hash = dof.ca.getHash();
+#else
+                        const Hash & hash = dof.hash.hash;
+#endif
+                        switch (hash.type) {
                           case htMD5: 
                             hashType = 0;
                             break;
@@ -491,14 +519,35 @@
                             hashType = -1;
                             break;
                         }
-                        hashSize = dof.hash.hash.hashSize;
+                        hashSize = hash.hashSize;
                         hashValue = (char*)malloc(hashSize);
                         std::memcpy((void*)(hashValue),
-                                    (void*)(dof.hash.hash.hash),
+                                    (void*)(hash.hash),
                                     hashSize);
                       },
                       [&](DerivationOutputCAFloating dof) -> void {
                         typ = 2;
+#if NIX_IS_AT_LEAST(2, 16, 0)
+                        std::visit(overloaded {
+                          [&](nix::FileIngestionMethod fim_) -> void {
+                            switch (fim_) {
+                              case nix::FileIngestionMethod::Flat:
+                                fim = 0;
+                                break;
+                              case nix::FileIngestionMethod::Recursive:
+                                fim = 1;
+                                break;
+                              default:
+                                fim = -1;
+                                break;
+                            }
+                          },
+                          [&](nix::TextIngestionMethod) -> void {
+                            // FIXME (RFC 92)
+                            fim = -1;
+                          }
+                        }, dof.method.raw);
+#else
                         switch (dof.method) {
                           case nix::FileIngestionMethod::Flat:
                             fim = 0;
@@ -510,6 +559,7 @@
                             fim = -1;
                             break;
                         }
+#endif
                         switch (dof.hashType) {
                           case htMD5: 
                             hashType = 0;
diff --git a/test/Hercules/CNix/SettingsSpec.hs b/test/Hercules/CNix/SettingsSpec.hs
new file mode 100644
--- /dev/null
+++ b/test/Hercules/CNix/SettingsSpec.hs
@@ -0,0 +1,23 @@
+{-# LANGUAGE BlockArguments #-}
+
+module Hercules.CNix.SettingsSpec (spec) where
+
+import Hercules.CNix.Settings
+import Protolude
+import Test.Hspec
+
+spec :: Spec
+spec = do
+  describe "setUseSQLiteWAL" do
+    it "affects getUseSQLiteWAL" do
+      withResettingUseSQLiteWAL do
+        for_ [True, False] \v -> do
+          setUseSQLiteWAL v
+          v' <- getUseSQLiteWAL
+          v' `shouldBe` v
+
+-- bracket on global state is a leaky abstraction, so we don't add this
+-- to the library.
+withResettingUseSQLiteWAL :: IO a -> IO a
+withResettingUseSQLiteWAL =
+  bracket getUseSQLiteWAL setUseSQLiteWAL . const
