aboutsummaryrefslogtreecommitdiff
path: root/pkgs/weznix.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/weznix.nix')
-rw-r--r--pkgs/weznix.nix45
1 files changed, 32 insertions, 13 deletions
diff --git a/pkgs/weznix.nix b/pkgs/weznix.nix
index 338ddf3..bd1bd3a 100644
--- a/pkgs/weznix.nix
+++ b/pkgs/weznix.nix
@@ -1,5 +1,6 @@
{ wezterm,
makeWrapper,
+ symlinkJoin,
writeText,
nixToLua,
lib,
@@ -27,14 +28,17 @@
weznix = require('weznix')
local cfgDir = weznix.luaPath
- if (weznix.wrapConfig == false) or (type(weznix.wrapConfig) == "string" and os.getenv(weznix.wrapConfig == 1) then
+ if (weznix.wrapConfig == false) or (type(weznix.wrapConfig) == "string" and os.getenv(weznix.wrapConfig) == 1) then
cfgDir = weznix.configDirectory
end
- require('wezterm').config_dir = cfgDir
+ -- require('wezterm').config_dir = cfgDir
+ wezterm = require('wezterm')
+ wezterm.config_dir = cfgDir
- package.path = package.path .. ';' .. cfgDir .. '/?.lua'
+ -- package.path = package.path .. ';' .. cfgDir .. '/?.lua'
+ package.path = cfgDir .. '/?.lua'
package.cpath = package.cpath .. ';' .. cfgDir .. '/?.so'
@@ -42,21 +46,36 @@
'';
wrapperArgs = [
- # "--prefix" "PATH" ":" (lib.makeBinPath extraPATH)
"--set" "WEZTERM_CONFIG_FILE" (toString wezinit)
+ ] ++ lib.optionals (extraPATH != []) [
+ "--prefix" "PATH" ":" (lib.makeBinPath extraPATH)
] ++ extraWrapperArgs;
-in wezterm.overrideAttrs ({ postInstall ? "", nativeBuildInputs ? [], buildInputs ? [], ... }: {
- nativeBuildInputs = nativeBuildInputs ++ [ makeWrapper ];
-
- buildInputs = buildInputs ++ extraPATH;
-
- postInstall = # bash
+in (symlinkJoin {
+ name = "wezterm";
+ nativeBuildInputs = [ makeWrapper ];
+ paths = [ wezterm ];
+ postBuild = # bash
''
- ${postInstall}
-
for bin in $out/bin/wezterm*; do
wrapProgram "$bin" ${lib.escapeShellArgs wrapperArgs}
done
'';
- })
+ }) // {
+ inherit (wezterm) version name passthru meta;
+}
+
+# in wezterm.overrideAttrs ({ postInstall ? "", nativeBuildInputs ? [], buildInputs ? [], ... }: {
+# nativeBuildInputs = nativeBuildInputs ++ [ makeWrapper ];
+#
+# buildInputs = buildInputs ++ extraPATH;
+#
+# postInstall = # bash
+# ''
+# ${postInstall}
+#
+# for bin in $out/bin/wezterm*; do
+# wrapProgram "$bin" ${lib.escapeShellArgs wrapperArgs}
+# done
+# '';
+# })