From f4a8910efc28ba10dfcb560068e998164cce2453 Mon Sep 17 00:00:00 2001 From: Mitch Tishmack Date: Sun, 23 Aug 2015 20:03:13 -0500 Subject: [PATCH] Update nix target. --- nix/.nixpkgs/config.nix | 27 +++++++++++++++++++++++++++ nix/.profile.d/20-functions-nix.sh | 8 ++++++++ nix/.profile.d/99-final-nix.sh | 7 +++++-- 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 nix/.nixpkgs/config.nix diff --git a/nix/.nixpkgs/config.nix b/nix/.nixpkgs/config.nix new file mode 100644 index 0000000..a41e28f --- /dev/null +++ b/nix/.nixpkgs/config.nix @@ -0,0 +1,27 @@ +{ + packageOverrides = super: let self = super.pkgs; in { + myHaskellEnv = + self.haskell.packages.ghc7102.ghcWithPackages + (haskellPackages: with haskellPackages; [ + aeson + arrows + async + bake + cabal-install + case-insensitive + ghc-mod + hindent + hoogle + hspec + inline-c + pandoc + shake + ShellCheck + Spock + stack + stylish-haskell + wreq + ] + ); + }; +} diff --git a/nix/.profile.d/20-functions-nix.sh b/nix/.profile.d/20-functions-nix.sh index 135c808..bca2c98 100644 --- a/nix/.profile.d/20-functions-nix.sh +++ b/nix/.profile.d/20-functions-nix.sh @@ -6,3 +6,11 @@ mk_nix_shell() | sed -E -e 's/(cabal\.mkDerivation)/with haskellPackages; \1/' -e 'sXsha256 = "0";Xsrc = "./.";X' \ > shell.nix; } + +nix_env_setup() +{ + NIX_GHC=$(type -p ghc > /dev/null 2>&1) + if [ -n "$NIX_GHC" ]; then + eval $(grep export "$NIX_GHC") + fi +} diff --git a/nix/.profile.d/99-final-nix.sh b/nix/.profile.d/99-final-nix.sh index 934c7da..3108a4f 100755 --- a/nix/.profile.d/99-final-nix.sh +++ b/nix/.profile.d/99-final-nix.sh @@ -3,6 +3,9 @@ # The nix installer put something like this into the .profile. # BAD INSTALLER NO COOKIE! if [ -e ${HOME}/.nix-profile/etc/profile.d/nix.sh ]; then - . ${HOME}/.nix-profile/etc/profile.d/nix.sh; - export NIX_PATH=${HOME}/src/github.com/NixOS/nixpkgs:nixpkgs=${HOME}/src/github.com/NixOS/nixpkgs + . ${HOME}/.nix-profile/etc/profile.d/nix.sh; + export NIX_PATH=${HOME}/src/github.com/NixOS/nixpkgs:nixpkgs=${HOME}/src/github.com/NixOS/nixpkgs + export NIX_CFLAGS_COMPILE="-idirafter /usr/include" + export NIX_CFLAGS_LINK="-L/usr/lib" + nix_env_setup fi