nix-thunk-0.5.0.0: Lightweight dependency management 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

Instances details
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

Instances details
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 packed or unpacked thunk based on predefined thunk specifications.

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 #

createThunk' :: MonadNixThunk m => ThunkCreateConfig -> m () Source #

newtype ThunkConfig Source #

Constructors

ThunkConfig 

Instances

Instances details
Show ThunkConfig Source # 
Instance details

Defined in Nix.Thunk

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

updateThunk :: MonadNixThunk m => FilePath -> (FilePath -> m a) -> m a Source #

Safely update thunk using a custom action

A temporary working space is used to do any update. When the custom action successfully completes, the resulting (packed) thunk is copied back to the original location.

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 NixThunkError 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

newtype GitUri Source #

Constructors

GitUri 

Fields

Instances

Instances details
Eq GitUri Source # 
Instance details

Defined in Nix.Thunk

Methods

(==) :: GitUri -> GitUri -> Bool #

(/=) :: GitUri -> GitUri -> Bool #

Ord GitUri Source # 
Instance details

Defined in Nix.Thunk

Show GitUri Source # 
Instance details

Defined in Nix.Thunk

uriThunkPtr :: MonadNixThunk m => GitUri -> Maybe Bool -> Maybe Text -> Maybe Text -> m ThunkPtr Source #

Convert a URI to a thunk

If the URL is a github URL, we try to just download an archive for performance. If that doesn't work (e.g. authentication issue), we fall back on just doing things the normal way for git repos in general, and save it as a regular git thunk.

newtype Ref hash Source #

Represent a git reference (SHA1)

Constructors

Ref 

Fields

Instances

Instances details
Eq (Ref hash) Source # 
Instance details

Defined in Nix.Thunk

Methods

(==) :: Ref hash -> Ref hash -> Bool #

(/=) :: Ref hash -> Ref hash -> Bool #

Ord (Ref hash) Source # 
Instance details

Defined in Nix.Thunk

Methods

compare :: Ref hash -> Ref hash -> Ordering #

(<) :: Ref hash -> Ref hash -> Bool #

(<=) :: Ref hash -> Ref hash -> Bool #

(>) :: Ref hash -> Ref hash -> Bool #

(>=) :: Ref hash -> Ref hash -> Bool #

max :: Ref hash -> Ref hash -> Ref hash #

min :: Ref hash -> Ref hash -> Ref hash #

Show (Ref hash) Source # 
Instance details

Defined in Nix.Thunk

Methods

showsPrec :: Int -> Ref hash -> ShowS #

show :: Ref hash -> String #

showList :: [Ref hash] -> ShowS #