Skip to content

Commit 6634a85

Browse files
author
arch
committed
add nix support
1 parent c6c9b93 commit 6634a85

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

contrib/Installer/assets/main.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
json = require "json"
2-
-- MTFG LUA Wrappper Version 2.0.0
2+
-- MTFG LUA Wrappper Version 2.0.1
33

44
-- global var
55
processHandleMTFG = nil
@@ -32,6 +32,8 @@ function get_platform()
3232
return "Linux, Conda"
3333
elseif exists(home.."/anaconda3/envs/funscript-editor") then
3434
return "Linux, Conda"
35+
elseif exists("/nix/store") then
36+
return "Linux, Nix"
3537
else
3638
return "Linux, Python"
3739
end
@@ -81,6 +83,9 @@ function binding.start_funscript_generator()
8183
elseif platform == "Linux, Conda" then
8284
cmd = "/usr/bin/bash"
8385
table.insert(args, ofs.ExtensionDir() .. "/Python-Funscript-Editor/conda_wrapper.sh")
86+
elseif platform == "Linux, Nix" then
87+
cmd = "/usr/bin/bash"
88+
table.insert(args, ofs.ExtensionDir() .. "/Python-Funscript-Editor/nix_wrapper.sh")
8489
else
8590
print("ERROR: Platform Not Implemented (", platform, ")")
8691
end

nix_wrapper.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/bash
2+
3+
root_dir="$(dirname $0)"
4+
cmd="python3 `dirname $0`/funscript-editor.py $@"
5+
echo "cmd: $cmd" > /tmp/mtfg-nix.log
6+
echo "dir: $root_dir" >> /tmp/mtfg-nix.log
7+
cd $root_dir && nix-shell --run "$cmd" >> /tmp/mtfg-nix.log 2>&1

0 commit comments

Comments
 (0)