nix-graph 1.0.1.0 → 1.0.2.0
raw patch · 3 files changed
+19/−3 lines, 3 filesdep +unordered-containersdep ~algebraic-graphsPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies added: unordered-containers
Dependency ranges changed: algebraic-graphs
API changes (from Hackage documentation)
+ Nix.Graph: [derivationEnv] :: Derivation -> HashMap Text Text
+ Nix.Graph.Internal: [derivationEnv] :: Derivation -> HashMap Text Text
- Nix.Graph: Derivation :: FilePath -> Text -> [FilePath] -> Bool -> Derivation
+ Nix.Graph: Derivation :: FilePath -> Text -> [FilePath] -> Bool -> HashMap Text Text -> Derivation
- Nix.Graph.Internal: Derivation :: FilePath -> Text -> [FilePath] -> Bool -> Derivation
+ Nix.Graph.Internal: Derivation :: FilePath -> Text -> [FilePath] -> Bool -> HashMap Text Text -> Derivation
Files
- CHANGELOG.md +4/−0
- nix-graph.cabal +2/−1
- src/Nix/Graph/Internal.hs +13/−2
CHANGELOG.md view
@@ -7,6 +7,10 @@ ## [Unreleased] +## [1.0.2.0] - 2022-05-12+### Added+- New field `derivationEnv` of `Derivation`.+ ## [1.0.1.0] - 2022-02-09 ### Added - New function `buildFull` to get back the nix graph of Derivations instead of FilePaths.
nix-graph.cabal view
@@ -1,7 +1,7 @@ cabal-version: 2.2 name: nix-graph-version: 1.0.1.0+version: 1.0.2.0 synopsis: Reify the Nix build graph into a Haskell graph data structure description: Reify the Nix build graph into a Haskell graph data structure category: Nix, Graphs@@ -52,6 +52,7 @@ , text , ttrie >= 0.1.2 && < 0.2 , unliftio >= 0.2.6 && < 0.3+ , unordered-containers exposed-modules: Nix.Graph Nix.Graph.Internal
src/Nix/Graph/Internal.hs view
@@ -16,7 +16,7 @@ import Control.Monad (unless, when) import Control.Monad.IO.Class (MonadIO (..)) import Data.Attoparsec.Text ((<?>))-import Data.Hashable (Hashable)+import Data.Hashable (Hashable (..)) import Data.Set (Set) import Data.Text (Text) import GHC.Generics (Generic)@@ -27,6 +27,7 @@ import qualified Control.Concurrent.STM.Map as STM.Map import qualified Control.Concurrent.STM.TSem as TSem import qualified Data.Attoparsec.Text as Attoparsec+import qualified Data.HashMap.Strict as HashMap import qualified Data.Map as Map import qualified Data.Set as Set import qualified Data.Text as Text@@ -52,6 +53,7 @@ , derivationSystem :: Text , derivationInputDrvs :: [FilePath] , derivationBuilt :: Bool+ , derivationEnv :: HashMap.HashMap Text Text } deriving stock (Eq, Ord, Generic) deriving anyclass (Hashable)@@ -79,7 +81,16 @@ let derivationSystem = Nix.Derivation.platform drv - pure Derivation{derivationPath, derivationBuilt, derivationSystem, derivationInputDrvs}+ let derivationEnv = HashMap.fromList (Map.toList (Nix.Derivation.env drv))++ pure+ Derivation+ { derivationPath+ , derivationBuilt+ , derivationSystem+ , derivationInputDrvs+ , derivationEnv+ } buildAdjacencyMap :: MonadIO m =>