cabal2nix alternatives and similar packages
Based on the "Distribution" category.
Alternatively, view cabal2nix alternatives based on common mentions on social networks and blogs.
-
Cabal-ide-backend
Official upstream development repository for Cabal and cabal-install -
stackage
Stable Haskell package sets: vetted consistent packages from Hackage -
cabal-dev
A wrapper program around cabal and cabal-install that maintains sandboxed build environments. -
hackage-repo-tool
Hackage security framework based on TUF (The Update Framework) -
hackage-security-HTTP
Hackage security framework based on TUF (The Update Framework) -
hackage-security
Hackage security framework based on TUF (The Update Framework) -
redo
djb's redo implementation in Haskell (for Haskell from Scratch video series) -
cabal-helper
Give Haskell development tools access to Cabal project environment. -
hackport
A command line tool to generate Gentoo ebuilds from Hackage packages. -
stackage-upload
A more secure version of cabal upload which uses HTTPS -
cabal-bounds
Set the version bounds of dependencies in a cabal file -
stackage-cabal
A CLI executable for cabal-based stackage commands -
cabal-meta
avoid cabal dependency hell by installing all your cabal dependencies at the same time -
haddocset
Generate docset of Dash by Haddock haskell documentation tool -
hackage-diff
Compare the public API of different versions of a Hackage library -
cblrepo
Tool to simplify managing a consistent set of Haskell packages for distributions. -
language-nix
Data types and useful functions to represent and manipulate the Nix language. | Source has moved to https://github.com/nixos/cabal2nix -
hackage-db
provide access to the Hackage database via Data.Map | Source has moved to https://github.com/nixos/cabal2nix -
haskell-packages
Haskell suite library for package management and integration with Cabal -
cabal-dependency-licenses
Compose a list of a project's transitive dependencies with their licenses -
distribution-nixpkgs
Haskell types and functions to represent, query, and manipulate the Nixpkgs distribution. | Source has moved to https://github.com/nixos/cabal2nix -
jailbreak-cabal
Strip version restrictions from build dependencies in Cabal files. -
haskell-updater
rebuilds Haskell packages after a GHC upgrade or a dependency upgrade -
cabal-uninstall
Very simple Haskell script to uninstall cabal packages -
stackage-update
Update your package index incrementally (requires git) -
dynamic-cabal
Dynamically load the Cabal library to use a newer version with the GHC API -
stackage-metadata
Tool for extracting metadata on all packages -
cabal-file-th
Template haskell function to bring cabal file fields into your source. -
cabal-constraints
Repeatable builds for cabalized Haskell projects
TestGPT | Generating meaningful tests for busy devs
Do you think we are missing an alternative of cabal2nix or a related project?
README
Cabal2nix
cabal2nix
converts a single Cabal file into a single Nix build expression.
For example:
$ cabal2nix cabal://mtl
{ mkDerivation, base, lib, transformers }:
mkDerivation {
pname = "mtl";
version = "2.2.1";
sha256 = "1icdbj2rshzn0m1zz5wa7v3xvkf6qw811p4s7jgqwvx1ydwrvrfa";
libraryHaskellDepends = [ base transformers ];
homepage = "http://github.com/ekmett/mtl";
description = "Monad classes, using functional dependencies";
license = lib.licenses.bsd3;
}
Cabal files can be referred to using the magic URL cabal://NAME-VERSION
,
which will automatically download the file from Hackage. Alternatively, a
direct http://host/path/pkg.cabal
URL can be provided, as well as a
file:///local/path/pkg.cabal
URI that doesn't depend on network access.
However, if the source hash is not already in cabal2nix
's cache or provided
using the --sha256
option, cabal2nix
still needs to download the source
code to compute the hash, which still causes network traffic. Run the utility
with --help
to see the complete list of supported command-line flags.
Detailed instructions on how to use those generated files with Nix can be found at https://haskell4nix.readthedocs.io/nixpkgs-users-guide.html#how-to-create-nix-builds-for-your-own-private-haskell-packages.
cabal2nix
can also build derivations for projects from other sources than
Hackage. You only need to provide a URI that points to a cabal project. The
most common use-case for this is probably to generate a derivation for a
project on the local file system:
$ cabal get mtl-2.2.1 && cd mtl-2.2.1
$ cabal2nix .
{ mkDerivation, base, lib, transformers }:
mkDerivation {
pname = "mtl";
version = "2.2.1";
src = ./.;
libraryHaskellDepends = [ base transformers ];
homepage = "http://github.com/ekmett/mtl";
description = "Monad classes, using functional dependencies";
license = lib.licenses.bsd3;
}
This derivation will not fetch from hackage, but instead use the directory which contains the derivation as the source repository.
cabal2nix
currently supports the following repository types:
- directory
- source archive (zip, tar.gz, ...) from http or https URL or local file.
- git, mercurial, svn or bazaar repository
hackage2nix
This repository also contains, in the [hackage2nix/
](./hackage2nix) directory,
the tool to update the Haskell packages in
nixpkgs. It has its own README there.
Building
cabal2nix
is built using cabal-install
,
like you'd expect, and you are free to use your favourite way of setting up
a Haskell development environment.
Since cabal2nix
is quite intertwined with the packages distribution-nixpkgs
and hackage-db
, we recommend setting up a shared development environment
for the three packages like so:
$ mkdir /path/to/cabal2nix-root && cd /path/to/cabal2nix-root
$ # clone repositories, note that you may need to checkout an
$ # older tag for some depending on breaking changes on master.
$ git clone https://github.com/NixOS/cabal2nix.git
$ git clone https://github.com/NixOS/hackage-db.git
$ git clone https://github.com/NixOS/distribution-nixpkgs.git
$ # setup development environment with shellFor
$ cat > shell.nix << EOF
# assumes nix{os,pkgs}-unstable
{ pkgs ? import <nixpkgs> {} }:
pkgs.haskellPackages.shellFor {
packages = p: [
p.cabal2nix-unstable
p.distribution-nixpkgs
p.hackage-db
];
# for running doctests locally
nativeBuildInputs = [
pkgs.haskellPackages.doctest
];
# set environment variable, so the development version of
# distribution-nixpkgs finds derivation-attr-paths.nix
distribution_nixpkgs_datadir = toString ./distribution-nixpkgs;
}
EOF
$ # tell cabal about local packages
$ cat > cabal.project << EOF
packages: ./*/*.cabal
EOF
$ # test our new development environment
$ nix-shell --run "cabal v2-build exe:cabal2nix exe:hackage2nix"
*Note that all licence references and agreements mentioned in the cabal2nix README section above
are relevant to that project's source code only.