Nix configuration

This commit is contained in:
Matvey Aksenov 2015-06-08 20:24:37 +00:00
parent cc03a13711
commit c94763606b
3 changed files with 36 additions and 0 deletions

2
default.nix Normal file
View File

@ -0,0 +1,2 @@
{ nixpkgs ? import <nixpkgs> {}, compiler ? "ghc7101" }:
nixpkgs.pkgs.haskell.packages.${compiler}.callPackage ./ldap-client.nix {}

17
ldap-client.nix Normal file
View File

@ -0,0 +1,17 @@
{ mkDerivation, asn1-encoding, asn1-types, async, base, bytestring
, connection, containers, doctest, hspec, network, process
, semigroups, stdenv, stm, text
}:
mkDerivation {
pname = "ldap-client";
version = "0.1.0";
src = ./.;
buildDepends = [
asn1-encoding asn1-types async base bytestring connection
containers network semigroups stm text
];
testDepends = [ base bytestring doctest hspec process semigroups ];
homepage = "https://supki.github.io/ldap-client";
description = "Pure Haskell LDAP Client Library";
license = stdenv.lib.licenses.bsd2;
}

17
shell.nix Normal file
View File

@ -0,0 +1,17 @@
{ nixpkgs ? import <nixpkgs> {}, compiler ? "ghc7101" }: let
inherit (nixpkgs) pkgs;
ghc = pkgs.haskell.packages.${compiler}.ghcWithPackages( ps: with ps; [
hdevtools doctest
]);
cabal-install = pkgs.haskell.packages.${compiler}.cabal-install;
pkg = (import ./default.nix { inherit nixpkgs compiler; });
in
pkgs.stdenv.mkDerivation rec {
name = pkg.pname;
buildInputs = [ ghc cabal-install ] ++ pkg.env.buildInputs;
shellHook = ''
${pkg.env.shellHook}
export IN_WHICH_NIX_SHELL=${name}
cabal configure --package-db=$NIX_GHC_LIBDIR/package.conf.d
'';
}