aboutsummaryrefslogtreecommitdiffstats
path: root/shell.nix
diff options
context:
space:
mode:
authors-ol <s+removethis@s-ol.nu>2020-12-03 10:43:09 +0000
committers-ol <s+removethis@s-ol.nu>2020-12-03 16:35:11 +0000
commit8982b9fbff03c9965cd4dcd105847eabd82a45d1 (patch)
tree9f0b6d5c6df2913adb79cfdd9274f71032c023df /shell.nix
parentmake fs store default (diff)
downloadmmm-8982b9fbff03c9965cd4dcd105847eabd82a45d1.tar.gz
mmm-8982b9fbff03c9965cd4dcd105847eabd82a45d1.zip
add shell.nix
Diffstat (limited to 'shell.nix')
-rw-r--r--shell.nix60
1 files changed, 60 insertions, 0 deletions
diff --git a/shell.nix b/shell.nix
new file mode 100644
index 0000000..5131563
--- /dev/null
+++ b/shell.nix
@@ -0,0 +1,60 @@
+{ pkgs ? import <nixpkgs> {}
+}:
+
+let
+ # see https://github.com/mpx/lua-cjson/issues/56
+ cjson = pkgs.lua53Packages.buildLuarocksPackage rec {
+ pname = "lua-cjson";
+ version = "2.1.0-1";
+
+ src = pkgs.fetchurl {
+ url = "mirror://luarocks//lua-cjson-2.1.0-1.src.rock";
+ sha256 = "23r4ScVV0aR09yn+Sla1Uw6b57JHSet6fEdKfHIHuXI=";
+ };
+ propagatedBuildInputs = [ pkgs.lua5_3 ];
+
+ meta = with pkgs.stdenv.lib; {
+ homepage = "https://www.kyne.com.au/~mark/software/lua-cjson.php";
+ description = "A fast JSON encoding/parsing module";
+ license.fullName = "MIT";
+ };
+ };
+
+ discount = pkgs.lua53Packages.buildLuarocksPackage {
+ pname = "discount";
+ version = "0.4-1";
+
+ knownRockspec = (pkgs.fetchurl {
+ url = https://luarocks.org/discount-0.4-1.rockspec;
+ sha256 = "0mc2mwkprf8li2v91vga77rwi0xhv989nxshi66z2d45lbl1dcpd";
+ }).outPath;
+
+ src = pkgs.fetchurl {
+ url = https://craigbarnes.gitlab.io/dist/lua-discount/lua-discount-0.4.tar.gz;
+ sha256 = "1bfyrxjr26gbahawdynlbp48ma01gyd3b6xbljvxb2aavvfywc9m";
+ };
+
+ buildInputs = [ pkgs.discount ];
+ propagatedBuildInputs = [ pkgs.lua5_3 ];
+
+ meta = with pkgs.stdenv.lib; {
+ homepage = "https://github.com/craigbarnes/lua-discount";
+ description = "Lua bindings for the Discount Markdown library";
+ license.fullName = "ISC";
+ };
+ };
+
+in pkgs.mkShell {
+ name = "mmm-env";
+ buildInputs = with pkgs; [
+ tup sassc entr
+ (lua5_3.withPackages (p: with p; [ moonscript http cjson discount busted ]))
+ ];
+ shellHook = ''
+ runServer () {
+ find build mmm -name '*.moon' | entr -dr moon build/server.moon "$@"
+ }
+ echo -e "\e[90m# run hot-reload server: \e[31mrunServer …\e[0m"
+ '';
+ LUA_PATH = "?.lua;?/init.lua";
+}