Skip to content

Instantly share code, notes, and snippets.

@purefn
Created March 6, 2015 15:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save purefn/9926ded12254ca763693 to your computer and use it in GitHub Desktop.
Save purefn/9926ded12254ca763693 to your computer and use it in GitHub Desktop.
Nix Haskell dev shell
#!/usr/bin/env bash
TOOLS="ctags haskellngPackages.codex haskellngPackages.ghc-mod haskellngPackages.hasktags haskellngPackages.hlint haskellngPackages.hscope haskellngPackages.pointfree haskellngPackages.pointful haskellngPackages.stylish-haskell"
EXPR="with (import <nixpkgs> {}).pkgs; with (import <nixpkgs/pkgs/development/haskell-modules/lib.nix> { inherit pkgs; });"
if [ -e "shell.nix" ]
then
PKG="(import ./shell.nix)"
else
PKG="myHaskellProject"
EXPR="$EXPR let myHaskellProject = (haskellngPackages.override { overrides = self: super: { myHaskellProject = self.callPackage ./. {}; }; }).myHaskellProject; in "
fi
EXPR="$EXPR (overrideCabal $PKG (drv: { buildTools = [ $TOOLS ]; } )).env"
nix-shell -E "$EXPR"
@steshaw
Copy link

steshaw commented Jun 3, 2015

This looks nice. Do you maintain this script somewheres?

@ublubu
Copy link

ublubu commented Sep 9, 2015

This looks like exactly what I've been searching for. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment