Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data ThunkSource
- data GitHubSource = GitHubSource {}
- data ThunkRev = ThunkRev {}
- getLatestRev :: MonadNixThunk m => ThunkSource -> m ThunkRev
- gitCloneForThunkUnpack :: MonadNixThunk m => GitSource -> Ref hash -> FilePath -> m ()
- thunkSourceToGitSource :: ThunkSource -> GitSource
- data ThunkPtr = ThunkPtr {}
- data ThunkData
- readThunk :: MonadNixThunk m => FilePath -> m (Either ReadThunkError ThunkData)
- data CheckClean
- getThunkPtr :: forall m. MonadNixThunk m => CheckClean -> FilePath -> Maybe Bool -> m ThunkPtr
- packThunk :: MonadNixThunk m => ThunkPackConfig -> FilePath -> m ThunkPtr
- createThunk :: MonadNixThunk m => FilePath -> Either ThunkSpec ThunkPtr -> m ()
- createThunk' :: MonadNixThunk m => ThunkCreateConfig -> m ()
- data ThunkPackConfig = ThunkPackConfig {}
- newtype ThunkConfig = ThunkConfig {}
- updateThunkToLatest :: MonadNixThunk m => ThunkUpdateConfig -> FilePath -> m ()
- updateThunk :: MonadNixThunk m => FilePath -> (FilePath -> m a) -> m a
- data ThunkUpdateConfig = ThunkUpdateConfig {}
- unpackThunk :: MonadNixThunk m => FilePath -> m ()
- data ThunkSpec = ThunkSpec {}
- data ThunkFileSpec
- data NixThunkError
- nixBuildAttrWithCache :: (MonadLog Output m, HasCliConfig NixThunkError m, MonadIO m, MonadMask m, MonadError NixThunkError m, MonadFail m) => FilePath -> String -> m FilePath
- attrCacheFileName :: FilePath
- prettyNixThunkError :: NixThunkError -> Text
- data ThunkCreateSource
- data ThunkCreateConfig = ThunkCreateConfig {}
- parseGitUri :: Text -> Maybe GitUri
- newtype GitUri = GitUri {}
- uriThunkPtr :: MonadNixThunk m => GitUri -> Maybe Bool -> Maybe Text -> Maybe Text -> m ThunkPtr
- newtype Ref hash = Ref {}
- refFromHexString :: HashAlgorithm hash => String -> Ref hash
Documentation
data ThunkSource Source #
A location from which a thunk's data can be retrieved
ThunkSource_GitHub GitHubSource | A source specialized for GitHub |
ThunkSource_Git GitSource | A plain repo source |
Instances
Eq ThunkSource Source # | |
Defined in Nix.Thunk.Internal (==) :: ThunkSource -> ThunkSource -> Bool Source # (/=) :: ThunkSource -> ThunkSource -> Bool Source # | |
Ord ThunkSource Source # | |
Defined in Nix.Thunk.Internal compare :: ThunkSource -> ThunkSource -> Ordering Source # (<) :: ThunkSource -> ThunkSource -> Bool Source # (<=) :: ThunkSource -> ThunkSource -> Bool Source # (>) :: ThunkSource -> ThunkSource -> Bool Source # (>=) :: ThunkSource -> ThunkSource -> Bool Source # max :: ThunkSource -> ThunkSource -> ThunkSource Source # min :: ThunkSource -> ThunkSource -> ThunkSource Source # | |
Show ThunkSource Source # | |
Defined in Nix.Thunk.Internal |
data GitHubSource Source #
Instances
Eq GitHubSource Source # | |
Defined in Nix.Thunk.Internal (==) :: GitHubSource -> GitHubSource -> Bool Source # (/=) :: GitHubSource -> GitHubSource -> Bool Source # | |
Ord GitHubSource Source # | |
Defined in Nix.Thunk.Internal compare :: GitHubSource -> GitHubSource -> Ordering Source # (<) :: GitHubSource -> GitHubSource -> Bool Source # (<=) :: GitHubSource -> GitHubSource -> Bool Source # (>) :: GitHubSource -> GitHubSource -> Bool Source # (>=) :: GitHubSource -> GitHubSource -> Bool Source # max :: GitHubSource -> GitHubSource -> GitHubSource Source # min :: GitHubSource -> GitHubSource -> GitHubSource Source # | |
Show GitHubSource Source # | |
Defined in Nix.Thunk.Internal |
A specific revision of data; it may be available from multiple sources
Instances
Eq ThunkRev Source # | |
Ord ThunkRev Source # | |
Defined in Nix.Thunk.Internal | |
Show ThunkRev Source # | |
getLatestRev :: MonadNixThunk m => ThunkSource -> m ThunkRev Source #
Get the latest revision available from the given source
gitCloneForThunkUnpack Source #
:: MonadNixThunk m | |
=> GitSource | Git source to use |
-> Ref hash | Commit hash to reset to |
-> FilePath | Directory to clone into |
-> m () |
A reference to the exact data that a thunk should translate into
Instances
Eq ThunkPtr Source # | |
Ord ThunkPtr Source # | |
Defined in Nix.Thunk.Internal | |
Show ThunkPtr Source # | |
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 #
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 #
data ThunkPackConfig Source #
Instances
Show ThunkPackConfig Source # | |
Defined in Nix.Thunk.Internal |
newtype ThunkConfig Source #
Instances
Show ThunkConfig Source # | |
Defined in Nix.Thunk.Internal |
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.
data ThunkUpdateConfig Source #
Instances
Show ThunkUpdateConfig Source # | |
Defined in Nix.Thunk.Internal |
unpackThunk :: MonadNixThunk m => FilePath -> m () 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.
ThunkFileSpec_Ptr (ByteString -> Either String ThunkPtr) | This file specifies |
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 |
data NixThunkError Source #
Instances
nixBuildAttrWithCache Source #
:: (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
data ThunkCreateSource Source #
The source to be used for creating thunks.
ThunkCreateSource_Absolute GitUri | Create a thunk from an absolute reference to a Git repository:
URIs like |
ThunkCreateSource_Relative FilePath | Create a thunk from a local folder. If the folder exists, then
it is made absolute using the current working directory and
treated as a |
Instances
Show ThunkCreateSource Source # | |
Defined in Nix.Thunk.Internal |
data ThunkCreateConfig Source #
Instances
Show ThunkCreateConfig Source # | |
Defined in Nix.Thunk.Internal |
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.
Represent a git reference (SHA1)
Instances
Eq (Ref hash) Source # | |
Ord (Ref hash) Source # | |
Defined in Nix.Thunk.Internal | |
Show (Ref hash) Source # | |
refFromHexString :: HashAlgorithm hash => String -> Ref hash Source #