@@ -158,7 +158,7 @@ addToStore name source recursive repair = do
158158 Control.Monad. when (repair == RepairMode_DoRepair )
159159 $ error " repairing is not supported when building through the Nix daemon"
160160
161- runOpArgsIO AddToStore $ \ yield -> do
161+ runOpArgsIO WorkerOp_AddToStore $ \ yield -> do
162162 yield $ Data.Serialize.Put. runPut $ do
163163 putText $ System.Nix.StorePath. unStorePathName name
164164 putBool
@@ -186,7 +186,7 @@ addTextToStore name text references' repair = do
186186 $ error " repairing is not supported when building through the Nix daemon"
187187
188188 storeDir <- getStoreDir
189- runOpArgs AddTextToStore $ do
189+ runOpArgs WorkerOp_AddTextToStore $ do
190190 putText name
191191 putText text
192192 putPaths storeDir references'
@@ -195,30 +195,30 @@ addTextToStore name text references' repair = do
195195addSignatures :: StorePath -> [ByteString ] -> MonadStore ()
196196addSignatures p signatures = do
197197 storeDir <- getStoreDir
198- Control.Monad. void $ simpleOpArgs AddSignatures $ do
198+ Control.Monad. void $ simpleOpArgs WorkerOp_AddSignatures $ do
199199 putPath storeDir p
200200 putByteStrings signatures
201201
202202addIndirectRoot :: StorePath -> MonadStore ()
203203addIndirectRoot pn = do
204204 storeDir <- getStoreDir
205- Control.Monad. void $ simpleOpArgs AddIndirectRoot $ putPath storeDir pn
205+ Control.Monad. void $ simpleOpArgs WorkerOp_AddIndirectRoot $ putPath storeDir pn
206206
207207-- | Add temporary garbage collector root.
208208--
209209-- This root is removed as soon as the client exits.
210210addTempRoot :: StorePath -> MonadStore ()
211211addTempRoot pn = do
212212 storeDir <- getStoreDir
213- Control.Monad. void $ simpleOpArgs AddTempRoot $ putPath storeDir pn
213+ Control.Monad. void $ simpleOpArgs WorkerOp_AddTempRoot $ putPath storeDir pn
214214
215215-- | Build paths if they are an actual derivations.
216216--
217217-- If derivation output paths are already valid, do nothing.
218218buildPaths :: HashSet StorePath -> BuildMode -> MonadStore ()
219219buildPaths ps bm = do
220220 storeDir <- getStoreDir
221- Control.Monad. void $ simpleOpArgs BuildPaths $ do
221+ Control.Monad. void $ simpleOpArgs WorkerOp_BuildPaths $ do
222222 putPaths storeDir ps
223223 putInt $ fromEnum bm
224224
@@ -229,7 +229,7 @@ buildDerivation
229229 -> MonadStore BuildResult
230230buildDerivation p drv buildMode = do
231231 storeDir <- getStoreDir
232- runOpArgs BuildDerivation $ do
232+ runOpArgs WorkerOp_BuildDerivation $ do
233233 putPath storeDir p
234234 putDerivation storeDir drv
235235 putEnum buildMode
@@ -247,7 +247,7 @@ deleteSpecific
247247 -> MonadStore GCResult
248248deleteSpecific paths = do
249249 storeDir <- getStoreDir
250- runOpArgs CollectGarbage $ do
250+ runOpArgs WorkerOp_CollectGarbage $ do
251251 putEnum GCAction_DeleteSpecific
252252 putPaths storeDir paths
253253 putBool False -- ignoreLiveness
@@ -265,12 +265,14 @@ deleteSpecific paths = do
265265ensurePath :: StorePath -> MonadStore ()
266266ensurePath pn = do
267267 storeDir <- getStoreDir
268- Control.Monad. void $ simpleOpArgs EnsurePath $ putPath storeDir pn
268+ Control.Monad. void
269+ $ simpleOpArgs WorkerOp_EnsurePath
270+ $ putPath storeDir pn
269271
270272-- | Find garbage collector roots.
271273findRoots :: MonadStore (Map ByteString StorePath )
272274findRoots = do
273- runOp FindRoots
275+ runOp WorkerOp_FindRoots
274276 sd <- getStoreDir
275277 res <-
276278 getSocketIncremental
@@ -292,7 +294,7 @@ findRoots = do
292294isValidPathUncached :: StorePath -> MonadStore Bool
293295isValidPathUncached p = do
294296 storeDir <- getStoreDir
295- simpleOpArgs IsValidPath $ putPath storeDir p
297+ simpleOpArgs WorkerOp_IsValidPath $ putPath storeDir p
296298
297299-- | Query valid paths from set, optionally try to use substitutes.
298300queryValidPaths
@@ -301,26 +303,26 @@ queryValidPaths
301303 -> MonadStore (HashSet StorePath )
302304queryValidPaths ps substitute = do
303305 storeDir <- getStoreDir
304- runOpArgs QueryValidPaths $ do
306+ runOpArgs WorkerOp_QueryValidPaths $ do
305307 putPaths storeDir ps
306308 putBool $ substitute == SubstituteMode_DoSubstitute
307309 sockGetPaths
308310
309311queryAllValidPaths :: MonadStore (HashSet StorePath )
310312queryAllValidPaths = do
311- runOp QueryAllValidPaths
313+ runOp WorkerOp_QueryAllValidPaths
312314 sockGetPaths
313315
314316querySubstitutablePaths :: HashSet StorePath -> MonadStore (HashSet StorePath )
315317querySubstitutablePaths ps = do
316318 storeDir <- getStoreDir
317- runOpArgs QuerySubstitutablePaths $ putPaths storeDir ps
319+ runOpArgs WorkerOp_QuerySubstitutablePaths $ putPaths storeDir ps
318320 sockGetPaths
319321
320322queryPathInfoUncached :: StorePath -> MonadStore (Metadata StorePath )
321323queryPathInfoUncached path = do
322324 storeDir <- getStoreDir
323- runOpArgs QueryPathInfo $ do
325+ runOpArgs WorkerOp_QueryPathInfo $ do
324326 putPath storeDir path
325327
326328 valid <- sockGetBool
@@ -369,30 +371,30 @@ queryPathInfoUncached path = do
369371queryReferrers :: StorePath -> MonadStore (HashSet StorePath )
370372queryReferrers p = do
371373 storeDir <- getStoreDir
372- runOpArgs QueryReferrers $ putPath storeDir p
374+ runOpArgs WorkerOp_QueryReferrers $ putPath storeDir p
373375 sockGetPaths
374376
375377queryValidDerivers :: StorePath -> MonadStore (HashSet StorePath )
376378queryValidDerivers p = do
377379 storeDir <- getStoreDir
378- runOpArgs QueryValidDerivers $ putPath storeDir p
380+ runOpArgs WorkerOp_QueryValidDerivers $ putPath storeDir p
379381 sockGetPaths
380382
381383queryDerivationOutputs :: StorePath -> MonadStore (HashSet StorePath )
382384queryDerivationOutputs p = do
383385 storeDir <- getStoreDir
384- runOpArgs QueryDerivationOutputs $ putPath storeDir p
386+ runOpArgs WorkerOp_QueryDerivationOutputs $ putPath storeDir p
385387 sockGetPaths
386388
387389queryDerivationOutputNames :: StorePath -> MonadStore (HashSet StorePath )
388390queryDerivationOutputNames p = do
389391 storeDir <- getStoreDir
390- runOpArgs QueryDerivationOutputNames $ putPath storeDir p
392+ runOpArgs WorkerOp_QueryDerivationOutputNames $ putPath storeDir p
391393 sockGetPaths
392394
393395queryPathFromHashPart :: StorePathHashPart -> MonadStore StorePath
394396queryPathFromHashPart storePathHash = do
395- runOpArgs QueryPathFromHashPart
397+ runOpArgs WorkerOp_QueryPathFromHashPart
396398 $ putText
397399 $ System.Nix.StorePath. storePathHashPartToText storePathHash
398400 sockGetPath
@@ -408,7 +410,7 @@ queryMissing
408410 )
409411queryMissing ps = do
410412 storeDir <- getStoreDir
411- runOpArgs QueryMissing $ putPaths storeDir ps
413+ runOpArgs WorkerOp_QueryMissing $ putPaths storeDir ps
412414
413415 willBuild <- sockGetPaths
414416 willSubstitute <- sockGetPaths
@@ -418,13 +420,13 @@ queryMissing ps = do
418420 pure (willBuild, willSubstitute, unknown, downloadSize', narSize')
419421
420422optimiseStore :: MonadStore ()
421- optimiseStore = Control.Monad. void $ simpleOp OptimiseStore
423+ optimiseStore = Control.Monad. void $ simpleOp WorkerOp_OptimiseStore
422424
423425syncWithGC :: MonadStore ()
424- syncWithGC = Control.Monad. void $ simpleOp SyncWithGC
426+ syncWithGC = Control.Monad. void $ simpleOp WorkerOp_SyncWithGC
425427
426428-- returns True on errors
427429verifyStore :: CheckMode -> RepairMode -> MonadStore Bool
428- verifyStore check repair = simpleOpArgs VerifyStore $ do
430+ verifyStore check repair = simpleOpArgs WorkerOp_VerifyStore $ do
429431 putBool $ check == CheckMode_DoCheck
430432 putBool $ repair == RepairMode_DoRepair
0 commit comments