@@ -27,6 +27,7 @@ module System.Nix.Store.Remote
2727 , runStore
2828 , syncWithGC
2929 , verifyStore
30+ , module System.Nix.Store.Types
3031 , module System.Nix.Store.Remote.Types
3132 ) where
3233
@@ -43,7 +44,7 @@ import qualified System.Nix.Hash
4344import qualified Data.ByteString.Lazy as BSL
4445
4546import System.Nix.Derivation (Derivation )
46- import System.Nix.Store.Types (FileIngestionMethod (.. ))
47+ import System.Nix.Store.Types (FileIngestionMethod (.. ), RepairMode ( .. ) )
4748import System.Nix.Build ( BuildMode
4849 , BuildResult
4950 )
@@ -82,10 +83,10 @@ addToStore
8283 => StorePathName -- ^ Name part of the newly created `StorePath`
8384 -> NarSource MonadStore -- ^ provide nar stream
8485 -> FileIngestionMethod -- ^ Add target directory recursively
85- -> RepairFlag -- ^ Only used by local store backend
86+ -> RepairMode -- ^ Only used by local store backend
8687 -> MonadStore StorePath
8788addToStore name source recursive repair = do
88- Control.Monad. when (unRepairFlag repair)
89+ Control.Monad. when (repair == RepairMode_DoRepair )
8990 $ error " repairing is not supported when building through the Nix daemon"
9091
9192 runOpArgsIO AddToStore $ \ yield -> do
@@ -108,10 +109,11 @@ addTextToStore
108109 :: Text -- ^ Name of the text
109110 -> Text -- ^ Actual text to add
110111 -> HashSet StorePath -- ^ Set of `StorePath`s that the added text references
111- -> RepairFlag -- ^ Repair flag, must be `False` in case of remote backend
112+ -> RepairMode -- ^ Repair mode, must be `RepairMode_DontRepair` for remote backend
113+ -- (only valid for local store)
112114 -> MonadStore StorePath
113115addTextToStore name text references' repair = do
114- Control.Monad. when (unRepairFlag repair)
116+ Control.Monad. when (repair == RepairMode_DoRepair )
115117 $ error " repairing is not supported when building through the Nix daemon"
116118
117119 storeDir <- getStoreDir
@@ -329,7 +331,7 @@ syncWithGC :: MonadStore ()
329331syncWithGC = Control.Monad. void $ simpleOp SyncWithGC
330332
331333-- returns True on errors
332- verifyStore :: CheckFlag -> RepairFlag -> MonadStore Bool
334+ verifyStore :: CheckFlag -> RepairMode -> MonadStore Bool
333335verifyStore check repair = simpleOpArgs VerifyStore $ do
334336 putBool $ unCheckFlag check
335- putBool $ unRepairFlag repair
337+ putBool $ repair == RepairMode_DoRepair
0 commit comments