diff options
author | tv <tv@krebsco.de> | 2017-04-30 14:34:39 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2017-04-30 15:46:32 +0200 |
commit | 936ad5f12422e3d124ade90fae78f9ed0427fc7d (patch) | |
tree | eba8cf47a94b5f532017e47274a683e361e79f31 /Makefile | |
parent | 14e952c60f5d39024fa754fd85f37abceef4787f (diff) |
Makefile: make nixpkgs overridable
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -1,3 +1,18 @@ + +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 @@ -7,7 +22,7 @@ clean: .PHONY: ghci ghci: shell.nix - nix-shell --arg nixpkgs 'import <stockholm>' --command 'exec ghci -Wall -fobject-code' + nix-shell --arg nixpkgs $(nixpkgs) --command 'exec ghci -Wall -fobject-code' .PHONY: install install: @@ -15,7 +30,7 @@ install: .PHONY: result result: shell.nix - nix-build --arg nixpkgs 'import <stockholm>' ./shell.nix + nix-build --arg nixpkgs $(nixpkgs) ./shell.nix shell.nix: $(wildcard *.cabal) cabal2nix --shell . > $@ |