summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile33
-rw-r--r--README30
2 files changed, 63 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..bad1a64
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,33 @@
+define newline
+
+
+endef
+
+shell-quote = '$(subst $(newline),'\$(newline)',$(subst ','\'',$(1)))'
+
+
+ifdef nixpkgs
+ override nixpkgs := $(call shell-quote,$(nixpkgs))
+else
+ nixpkgs = 'import <stockholm>'
+endif
+
+.PHONY: _default
+_default: ghci
+
+.PHONY: ghci
+ghci: shell.nix
+ nix-shell --arg nixpkgs $(nixpkgs) --command 'exec ghci -Wall' $<
+
+.PHONY: result
+result: shell.nix
+ nix-build --arg nixpkgs $(nixpkgs) $<
+
+shell.nix: $(wildcard *.cabal)
+ cabal2nix --shell . > $@
+
+.PHONY: update
+update:
+ git -C .hstool fetch origin
+ git -C .hstool reset --hard origin/master
+ git -C .hstool clean -dfx
diff --git a/README b/README
new file mode 100644
index 0000000..ca48800
--- /dev/null
+++ b/README
@@ -0,0 +1,30 @@
+hstool - Haskell Development Environment ^_^
+
+
+Requirements:
+ - cabal2nix
+ - Git
+ - GNU make
+ - Nix
+
+
+Installation:
+
+ git submodule add http://cgit.krebsco.de/hstool .hstool
+ git submodule update --init .hstool
+ ln -vsnf .hstool/Makefile
+
+
+Update hstool installation:
+
+ make update
+
+
+Start GHCi:
+
+ make ghci
+
+ This will by default use <stockholm> to obtain packages. If that's not
+ desired then nixpkgs can be specified explicitly:
+
+ make ghci nixpkgs='import /path/to/some/nixpkgs {}'