• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

jyp/styx: A nix-based Haskell project manager

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

jyp/styx

开源软件地址(OpenSource Url):

https://github.com/jyp/styx

开源编程语言(OpenSource Language):

Haskell 92.6%

开源软件介绍(OpenSource 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 new-<command>.

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 the packages that you edit locally and want compiled "all the time", by cabal:
local-packages:
  my-main-package: # package name
    location: main # location on your disk (directory)
  my-local-dep:    # package name
    location: dep  # location on your disk (directory)

# Optionally, 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

# Optionally, 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 well-formed 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, as 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 cabal.project file.

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 new-build in the shell
$ styx repl # runs cabal new-repl in the shell
$ styx exec <cmd> # runs cabal exec in the sandbox
$ styx cabal <cmd> # runs cabal <cmd> in the sandbox



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
haskell/pvp: Haskell Package Version Policy (PVP)发布时间:2022-06-24
下一篇:
morphismtech/squeal: Squeal, a deep embedding of SQL in Haskell发布时间:2022-06-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap