Skip to content

Instantly share code, notes, and snippets.

@expipiplus1
Created May 25, 2017 10:55
Show Gist options
  • Save expipiplus1/ac0a47db7f435dfd8b09136c3755655f to your computer and use it in GitHub Desktop.
Save expipiplus1/ac0a47db7f435dfd8b09136c3755655f to your computer and use it in GitHub Desktop.
{ myrtlepkgs ? import ../.. {} }:
let
pkgs = myrtlepkgs.nixpkgs;
inherit (pkgs) lib;
luaPackages = pkgs.lua51Packages;
luaPath = builtins.concatStringsSep ";" (map luaPackages.getLuaPath luaLibs);
luaCPath = builtins.concatStringsSep ";" (map luaPackages.getLuaCPath luaLibs);
# Add any additional lua libraries here. The list of available libraries can
# be found here:
# https://github.com/NixOS/nixpkgs/blob/1fdc34b73732715a74e926c4bee44c255df93360/pkgs/top-level/lua-packages.nix
luaLibs = with luaPackages; [cjson];
in
pkgs.stdenv.mkDerivation {
name = "torch-env";
nativeBuildInputs = with myrtlepkgs;
[ torch
];
shellHook = ''
export LUA_PATH=${luaPath}
export LUA_CPATH=${luaCPath}
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment