nix-thunk-0.1.0.0: Virtual vendorization with Nix

Safe HaskellNone
LanguageHaskell2010

Nix.Thunk

Synopsis

Documentation

data ThunkSource Source #

A location from which a thunk's data can be retrieved

Constructors

ThunkSource_GitHub GitHubSource

A source specialized for GitHub

ThunkSource_Git GitSource

A plain repo source

data ThunkRev Source #

A specific revision of data; it may be available from multiple sources

Constructors

ThunkRev 

Fields

Instances
Eq ThunkRev Source # 
Instance details

Defined in Nix.Thunk

Ord ThunkRev Source # 
Instance details

Defined in Nix.Thunk

Show ThunkRev Source # 
Instance details

Defined in Nix.Thunk

getLatestRev :: MonadNixThunk m => ThunkSource -> m ThunkRev Source #

Get the latest revision available from the given source

gitCloneForThunkUnpack Source #

Arguments

:: MonadNixThunk m 
=> GitSource

Git source to use

-> Ref hash

Commit hash to reset to

-> FilePath

Directory to clone into

-> m () 

data ThunkPtr Source #

A reference to the exact data that a thunk should translate into

Instances
Eq ThunkPtr Source # 
Instance details

Defined in Nix.Thunk

Ord ThunkPtr Source # 
Instance details

Defined in Nix.Thunk

Show ThunkPtr Source # 
Instance details

Defined in Nix.Thunk

data ThunkData Source #

Constructors

ThunkData_Packed ThunkSpec ThunkPtr

Packed thunk

ThunkData_Checkout

Checked out thunk that was unpacked from this pointer

readThunk :: MonadNixThunk m => FilePath -> m (Either ReadThunkError ThunkData) Source #

Read a thunk and validate that it is exactly a packed thunk. If additional data is present, fail.

data CheckClean Source #

Constructors

CheckClean_FullCheck

Check that the repo is clean, including .gitignored files

CheckClean_NotIgnored

Check that the repo is clean, not including .gitignored files

CheckClean_NoCheck

Don't check that the repo is clean

getThunkPtr :: forall m. MonadNixThunk m => CheckClean -> FilePath -> Maybe Bool -> m ThunkPtr Source #

packThunk :: MonadNixThunk m => ThunkPackConfig -> FilePath -> m ThunkPtr Source #

createThunk :: MonadNixThunk m => FilePath -> Either ThunkSpec ThunkPtr -> m () Source #

newtype ThunkConfig Source #

Constructors

ThunkConfig 
Instances
Show ThunkConfig Source # 
Instance details

Defined in Nix.Thunk

updateThunkToLatest :: MonadNixThunk m => ThunkUpdateConfig -> FilePath -> m () Source #

unpackThunk :: MonadNixThunk m => FilePath -> m () Source #

data ThunkSpec Source #

Specification for how a set of files in a thunk version work.

data ThunkFileSpec Source #

Specification for how a file in a thunk version works.

Constructors

ThunkFileSpec_Ptr (ByteString -> Either String ThunkPtr)

This file specifies ThunkPtr data

ThunkFileSpec_FileMatches Text

This file must match the given content exactly

ThunkFileSpec_CheckoutIndicator

Existence of this directory indicates that the thunk is unpacked

ThunkFileSpec_AttrCache

This directory is an attribute cache

nixBuildAttrWithCache Source #

Arguments

:: (MonadLog Output m, HasCliConfig m, MonadIO m, MonadMask m, MonadError NixThunkError m, MonadFail m) 
=> FilePath

Path to directory containing Thunk

-> String

Attribute to build

-> m FilePath

Symlink to cached or built nix output

Build a nix attribute, and cache the result if possible