diff --git a/Makefile b/Makefile index f625219..0e90fd6 100644 --- a/Makefile +++ b/Makefile @@ -5,12 +5,12 @@ STOWOPTS=-target $(HOME) -d $(PWD) DOTGITCONFIG=~/.gitconfig DOTPROFILE=~/.profile -.PHONY: mosh common emacs git ruby haskell perl tmux vim zsh list home osx linux ws +.PHONY: mosh common emacs git ruby haskell perl tmux vim zsh list home osx linux ws nix home: $(DOTGITCONFIG) $(DOTPROFILE) $(DOTDEE) $(DOTPROFILE) -ws: common mosh git ruby haskell perl tmux vim zsh home +ws: common emacs nix mosh git ruby haskell perl tmux vim zsh home all: home @@ -64,3 +64,6 @@ haskell: perl: $(STOW) $(STOWOPTS) perl + +nix: + $(STOW) $(STOWOPTS) nix diff --git a/nix/.profile.d/20-functions-nix.sh b/nix/.profile.d/20-functions-nix.sh new file mode 100644 index 0000000..135c808 --- /dev/null +++ b/nix/.profile.d/20-functions-nix.sh @@ -0,0 +1,8 @@ +# nix/.profile.d/20-functions-nix.sh +mk_nix_shell() +{ + cabal2nix --sha256="0" . \ + | perl -0777 -p -e 's/{.+}:/{ haskellPackages ? (import {}).haskellPackages }:/s' \ + | sed -E -e 's/(cabal\.mkDerivation)/with haskellPackages; \1/' -e 'sXsha256 = "0";Xsrc = "./.";X' \ + > shell.nix; +} diff --git a/nix/.profile.d/99-final-nix.sh b/nix/.profile.d/99-final-nix.sh new file mode 100755 index 0000000..7c485d7 --- /dev/null +++ b/nix/.profile.d/99-final-nix.sh @@ -0,0 +1,8 @@ +# 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}/Developer/github.com/NixOS/nixpkgs:nixpkgs=${HOME}/Developer/github.com/NixOS/nixpkgs +fi