From d56556b26fa0fb1d83804831445501269d66db42 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 6 Apr 2020 23:06:10 -0400 Subject: [PATCH] Generalize dev/love2d.nix into dev/lua.nix --- hosts/kuro/default.nix | 2 ++ modules/dev/default.nix | 2 +- modules/dev/love2d.nix | 15 --------------- modules/dev/lua.nix | 29 +++++++++++++++++++++++++++++ 4 files changed, 32 insertions(+), 16 deletions(-) delete mode 100644 modules/dev/love2d.nix create mode 100644 modules/dev/lua.nix diff --git a/hosts/kuro/default.nix b/hosts/kuro/default.nix index 00dc68a1..5c7146a2 100644 --- a/hosts/kuro/default.nix +++ b/hosts/kuro/default.nix @@ -42,6 +42,8 @@ cc.enable = true; common-lisp.enable = true; rust.enable = true; + # lua.enable = true; + # lua.love2d.enable = true; }; media = { diff --git a/modules/dev/default.nix b/modules/dev/default.nix index 1574a3df..26d32437 100644 --- a/modules/dev/default.nix +++ b/modules/dev/default.nix @@ -9,7 +9,7 @@ # ./godot.nix # ./haskell.nix # ./latex.nix - # ./love2d.nix + ./lua.nix # ./node.nix ./python.nix ./rust.nix diff --git a/modules/dev/love2d.nix b/modules/dev/love2d.nix deleted file mode 100644 index de3e76b3..00000000 --- a/modules/dev/love2d.nix +++ /dev/null @@ -1,15 +0,0 @@ -# modules/dev/love2d.nix --- https://love2d.org/ -# -# Love is my favorite little game engine. I use it often for rapid prototyping -# when godot is overkill and have the luxury of avoiding JS. I write my Love -# games in moonscript to get around the idiosynchrosies of lua. - -{ pkgs, ... }: -{ - my.packages = with pkgs; [ - love - lua - luaPackages.moonscript - luarocks - ]; -} diff --git a/modules/dev/lua.nix b/modules/dev/lua.nix new file mode 100644 index 00000000..8aa9fce2 --- /dev/null +++ b/modules/dev/lua.nix @@ -0,0 +1,29 @@ +# modules/dev/lua.nix --- https://www.lua.org/ +# +# I use lua for modding, awesomewm or Love2D for rapid gamedev prototyping (when +# godot is overkill and I have the luxury of avoiding JS). I write my Love games +# in moonscript to get around lua's idiosynchrosies. That said, I install love2d +# on a per-project basis. + +{ config, options, lib, pkgs, ... }: +with lib; +{ + options.modules.dev.lua = { + enable = mkOption { + type = types.bool; + default = false; + }; + }; + + config = mkIf config.modules.dev.lua.enable { + my = { + packages = with pkgs; [ + lua + luaPackages.moonscript + luarocks + ]; + + zsh.rc = ''eval "$(luarocks path --bin)"''; + }; + }; +}