@@ -13,7 +13,7 @@ import Data.Aeson
1313import Deriving.Aeson
1414import System.Nix.Base (BaseEncoding (NixBase32 ))
1515import System.Nix.OutputName (OutputName )
16- import System.Nix.Realisation (DerivationOutput , Realisation )
16+ import System.Nix.Realisation (DerivationOutput , Realisation , RealisationWithId ( .. ) )
1717import System.Nix.Signature (Signature )
1818import System.Nix.StorePath (StoreDir (.. ), StorePath , StorePathName , StorePathHashPart )
1919
@@ -159,18 +159,18 @@ deriving
159159 instance FromJSON Realisation
160160
161161-- For a keyed version of Realisation
162- -- we use (DerivationOutput OutputName, Realisation)
162+ -- we use RealisationWithId (DerivationOutput OutputName, Realisation)
163163-- instead of Realisation.id :: (DerivationOutput OutputName)
164164-- field.
165- instance {-# OVERLAPPING #-} ToJSON ( DerivationOutput OutputName , Realisation ) where
166- toJSON (drvOut, r) =
165+ instance ToJSON RealisationWithId where
166+ toJSON (RealisationWithId ( drvOut, r) ) =
167167 case toJSON r of
168168 Object o -> Object $ Data.Aeson.KeyMap. insert " id" (toJSON drvOut) o
169169 _ -> error " absurd"
170170
171- instance {-# OVERLAPPING #-} FromJSON ( DerivationOutput OutputName , Realisation ) where
171+ instance FromJSON RealisationWithId where
172172 parseJSON v@ (Object o) = do
173173 r <- parseJSON @ Realisation v
174174 drvOut <- o .: " id"
175- pure (drvOut, r)
175+ pure (RealisationWithId ( drvOut, r) )
176176 parseJSON x = fail $ " Expected Object but got " ++ show x
0 commit comments