funflow-nix: Utility functions for using funflow with nix

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain]

Warnings:

This library provides functions to create flows which run commands in environments created by nix commands. It is designed to be like the docker integration but the environments are created by nix rather than in a container.


[Skip to ReadMe]

Properties

Versions0.1.0.0, 0.1.0.0
Change logChangeLog.md
Dependenciesbase (>=4.10 && <5), funflow (>=1.4), funflow-nix, modern-uri, path, path-io, text [details]
LicenseBSD-3-Clause
AuthorMatthew Pickering
Maintainermatthewtpickering@gmail.com
Source repositoryhead: git clone https://github.com/mpickering/funflow-nix.git
Executablesexample
UploadedSat Nov 17 08:47:17 UTC 2018 by mpickering

Modules

[Index]

Flags

NameDescriptionDefaultType
example

Build the example executable

DisabledManual

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainers' corner

For package maintainers and hackage trustees


Readme for funflow-nix-0.1.0.0

[back to package description]

funflow-nix provides functions for creating flows which run in a nix environment.

The library exposes the NixConfig data type which allows you to specify the environment and command to run. This is then turned into a flow using nix.

A complete example can be seen in examples/Simple.hs.

We can pin the version of nixpkgs we want to use by specifying a tarball to use as the source.

tarballSource :: NixpkgsSource
tarballSource = NixpkgsTarball [uri|https://github.com/NixOS/nixpkgs/archive/a19357241973538212b5cb435dde84ad25cbe337.tar.gz|]

nixConfig :: Environment -> NixConfig
nixConfig senv =
  NixShellConfig {
    environment = senv
    , command = "jq"
    , args = [ParamText "--version"]
    , env = []
    , stdout = StdOutCapture
    , nixpkgsSource = tarballSource
  }

Once the config has been specified. It can be turned into a flow by using the nix function.

jqVersionPkg :: SimpleFlow () String
jqVersionPkg = readString_ <<< nix (\() -> nixConfig (PackageList ["jq"]))