diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..6d592b6 --- /dev/null +++ b/default.nix @@ -0,0 +1,2 @@ +{ nixpkgs ? import {}, compiler ? "ghc7101" }: +nixpkgs.pkgs.haskell.packages.${compiler}.callPackage ./ldap-client.nix {} diff --git a/ldap-client.nix b/ldap-client.nix new file mode 100644 index 0000000..5261345 --- /dev/null +++ b/ldap-client.nix @@ -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; +} diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..a611bd7 --- /dev/null +++ b/shell.nix @@ -0,0 +1,17 @@ +{ nixpkgs ? import {}, 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 + ''; + }