diff --git a/.vim.custom b/.vim.custom index 7444394..14785cb 100644 --- a/.vim.custom +++ b/.vim.custom @@ -1,14 +1,5 @@ function s:hdevtools_options(rgs) - return join(map(a:rgs, "'-g ' . v:val")) -endfunction - -function s:discover_cabal_sandbox(glob) - let l:sandboxes = split(glob(a:glob, "."), "\n") - if len(l:sandboxes) > 0 - return ['-no-user-package-db', '-package-db=' . l:sandboxes[-1]] - else - return [] - endif + return join(["-s", "/tmp/" . substitute(system("sha1sum <<< $PWD | cut -d' ' -f1"), '\n\+$', '', '') . ".sock"] + map(a:rgs, "'-g ' . v:val")) endfunction let g:syntastic_haskell_hdevtools_args = s:hdevtools_options @@ -23,5 +14,5 @@ let g:syntastic_haskell_hdevtools_args = s:hdevtools_options \ , '-Wall' \ , '-fno-warn-unused-do-bind' \ , '-fno-warn-type-defaults' - \ ] + s:discover_cabal_sandbox(".cabal-sandbox/*.conf.d") + \ ] \ ) diff --git a/default.nix b/default.nix index a3d9051..3656fcf 100644 --- a/default.nix +++ b/default.nix @@ -1,2 +1,9 @@ -{ nixpkgs ? import {}, compiler ? "ghc7102" }: -nixpkgs.pkgs.haskell.packages.${compiler}.callPackage ./ldap-client.nix {} +{ nixpkgs ? import {}, compiler ? "ghc7102" }: let + ghc = nixpkgs.pkgs.haskell.packages.${compiler}; + npm = import ./npm {}; +in + ghc.callPackage ./package.nix { + mkDerivation = args: ghc.mkDerivation(args // { + buildTools = (if args ? buildTools then args.buildTools else []) ++ [ npm.nodePackages.ldapjs ]; + }); + } diff --git a/ldap-client.nix b/package.nix similarity index 100% rename from ldap-client.nix rename to package.nix diff --git a/shell.nix b/shell.nix index 99cb495..29656cc 100644 --- a/shell.nix +++ b/shell.nix @@ -4,8 +4,8 @@ ps.hdevtools ps.doctest ps.hspec-discover ps.hlint ps.ghc-mod ]); cabal-install = pkgs.haskell.packages.${compiler}.cabal-install; - pkg = (import ./default.nix { inherit nixpkgs compiler; }); - npm = (import ./npm {}); + pkg = import ./default.nix { inherit nixpkgs compiler; }; + npm = import ./npm {}; in pkgs.stdenv.mkDerivation rec { name = pkg.pname;