diff options
| author | Chris Wells <chris@mathematicaster.org> | 2025-10-23 11:11:51 -0500 |
|---|---|---|
| committer | Chris Wells <chris@mathematicaster.org> | 2025-10-23 11:11:51 -0500 |
| commit | ca50606b98774565ba5f31caa6ec33601471480e (patch) | |
| tree | fda19026396c9d797bc43b9cc1d02caacd08c64a /pkgs/weznix.nix | |
| parent | c5f9420f4d111cccf4dc1bcc3ec35e75f68926e1 (diff) | |
| download | weznix-ca50606b98774565ba5f31caa6ec33601471480e.tar weznix-ca50606b98774565ba5f31caa6ec33601471480e.tar.gz weznix-ca50606b98774565ba5f31caa6ec33601471480e.tar.bz2 weznix-ca50606b98774565ba5f31caa6ec33601471480e.tar.lz weznix-ca50606b98774565ba5f31caa6ec33601471480e.tar.xz weznix-ca50606b98774565ba5f31caa6ec33601471480e.tar.zst weznix-ca50606b98774565ba5f31caa6ec33601471480e.zip | |
Debugging
Diffstat (limited to 'pkgs/weznix.nix')
| -rw-r--r-- | pkgs/weznix.nix | 45 |
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 +# ''; +# }) |
