From 9f04b548ce5c07cc86f43d0f26fda776d19c13bd Mon Sep 17 00:00:00 2001 From: Mitch Tishmack Date: Fri, 27 Nov 2015 01:24:00 -0600 Subject: [PATCH] Update nix setup, lets use nix. --- nix/.nixpkgs/config.nix | 60 +++++++++++++++++++++++++++++++--- nix/.profile.d/99-final-nix.sh | 36 +++++++++++++------- 2 files changed, 80 insertions(+), 16 deletions(-) diff --git a/nix/.nixpkgs/config.nix b/nix/.nixpkgs/config.nix index a901acd..5a8a158 100644 --- a/nix/.nixpkgs/config.nix +++ b/nix/.nixpkgs/config.nix @@ -1,12 +1,62 @@ -{ - packageOverrides = super: let self = super.pkgs; in { +{ pkgs }: { + packageOverrides = pkgs_: with pkgs_; { + default = with pkgs; buildEnv { + name = "default"; + paths = [ + ansible + ack + aria + iperf + curl + clang + git + gist + mercurial + docbook5 + entr + emacs + gnupg1 + gnutar + gnumake + sloccount + cloc + less + multitail + rlwrap + gdbm + mosh + htop + keychain + silver-searcher + aspell + aspellDicts.en + openssl + pigz + xz + pv + postgresql + python27Packages.youtube-dl + readline + rsync + sqlite + texLiveFull + tmux + tree + wget + wakelan + unzip + zip + upx + ]; + }; myHaskellEnv = - self.haskell.packages.ghc7102.ghcWithPackages + pkgs_.haskell.packages.ghc7102.ghcWithPackages (haskellPackages: with haskellPackages; [ aeson arrows async bake + cabal-dependency-licenses cabal-install case-insensitive ghc-mod @@ -17,12 +67,12 @@ pandoc shake ShellCheck - Spock stack stylish-haskell - regex-posix wreq ] ); }; + allowUnfree = true; + allowBroken = true; } diff --git a/nix/.profile.d/99-final-nix.sh b/nix/.profile.d/99-final-nix.sh index 3108a4f..638e493 100755 --- a/nix/.profile.d/99-final-nix.sh +++ b/nix/.profile.d/99-final-nix.sh @@ -1,11 +1,25 @@ -# nix.profile.d/99-final-nix.sh - -# 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 - export NIX_CFLAGS_COMPILE="-idirafter /usr/include" - export NIX_CFLAGS_LINK="-L/usr/lib" - nix_env_setup -fi +# nix/profile.d/99-final-nix.sh + +nix_env_setup() +{ + # 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 + export NIX_CFLAGS_COMPILE="-idirafter /usr/include" + export NIX_CFLAGS_LINK="-L/usr/lib" + + NIX_GHC=$(type -p ghc > /dev/null 2>&1) + if [ -n "$NIX_GHC" ]; then + eval $(grep export "$NIX_GHC") + fi + fi + + nr() + { + nix-shell --run "$(echo $@)" + } +} + +nix_env_setup