Git Product home page Git Product logo

styx's Introduction

Styx: a nix-based multi-repo Haskell project manager

β€œStyx: there is no looking back.”

Styx is a convenient wrapper around cabal2nix, nix-shell and cabal sandbox.

Installation

  • get nix: https://nixos.org/nix/
  • install the prerequisites (cabal2nix and cabal)
    nix-env -f "<nixpkgs>" -iA haskellPackages.cabal2nix
    nix-env -f "<nixpkgs>" -iA haskellPackages.cabal-install
        
  • install styx:
    nix-env -f "<nixpkgs>" -iA haskellPackages.styx
        

Configuration

In a directory of your choice, create a styx.yaml file like so:

# List first the packages that you edit locally and want compiled "all the time", by cabal:
local-packages:
  my-main-package: # package name
    location: .    # location on your disk
  my-local-dep:    # package name
    location: dep  # location on your disk

# Optional: list patched or cutting edge packages that you depend on.
# These will be compiled only once, by nix.
source-deps:
  mtl:
    location: https://github.com/mrawesome/awsm-patched-version-of-mtl.git
    # revision: cc9a31305421f6bc72cc1f107f1270bd178c78a1 # optional

# If you want you can add other haskell nix packages to depend on.
# Normally this is not necessary, because nix will track the dependencies on its own.
# Thus this section is mostly useful for throw-away projects which do not have a cabal file.
nix-deps:
    - criterion
    - gasp
    - lens
    - statistics

# In case you depend on other non-haskell tools or libs.
non-haskell-deps:
    - z3

# Optionally, one can ask for a specific version of nixpkgs:
nixpkgs:
  commit: 8ef3eaeb4e531929ec29a880cb4c67f790e5eb70
  sha256: 4d2fae900d2d99ea294f4f412289af77152ac21d7b2e9ff23581ef11ea00831f
  # or like this: url: https://github.com/NixOS/nixpkgs-channels/archive/nixos-14.12.tar.gz

# Optionally, one can ask for a specific version of ghc known by nixpkgs
default-compiler: ghc801

Then, the command

styx configure

will create one nix file for each external package, a suitable shell.nix, and a sandbox with sources for every local-package.

Use

You can then access the sandbox, inside the nix shell, like so:

nix-shell .styx/shell.nix --run "cabal ..."

Styx provides a couple of convenience commands:

$ styx build # runs cabal install in the sandbox
$ styx repl # runs cabal repl in the sandbox
$ styx exec <cmd> # runs cabal exec in the sandbox
$ styx cabal <cmd> # runs cabal <cmd> in the sandbox

styx's People

Contributors

aycanirican avatar chris-martin avatar jyp avatar mpickering avatar trofi avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.