From ca50606b98774565ba5f31caa6ec33601471480e Mon Sep 17 00:00:00 2001 From: Chris Wells Date: Thu, 23 Oct 2025 11:11:51 -0500 Subject: Debugging --- pkgs/weznix.nix | 45 ++++++++++++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 13 deletions(-) (limited to 'pkgs/weznix.nix') 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 +# ''; +# }) -- cgit v1.2.3