Generalize dev/love2d.nix into dev/lua.nix

This commit is contained in:
Henrik Lissner 2020-04-06 23:06:10 -04:00
parent 953c4c450b
commit d56556b26f
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
4 changed files with 32 additions and 16 deletions

View file

@ -42,6 +42,8 @@
cc.enable = true;
common-lisp.enable = true;
rust.enable = true;
# lua.enable = true;
# lua.love2d.enable = true;
};
media = {

View file

@ -9,7 +9,7 @@
# ./godot.nix
# ./haskell.nix
# ./latex.nix
# ./love2d.nix
./lua.nix
# ./node.nix
./python.nix
./rust.nix

View file

@ -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
];
}

29
modules/dev/lua.nix Normal file
View file

@ -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)"'';
};
};
}