From 0e0cd9d218288dd76af4830a133764ed88192e8c Mon Sep 17 00:00:00 2001 From: Chris Marchesi Date: Tue, 27 Jan 2026 11:35:25 -0800 Subject: [PATCH] lib: ensure the lib.wrap helper uses wrap binary This ensures that bwrap is available to the wrap.sh path (referencing wrap.sh directly requires bubblewrap to be installed into the default profile). --- flake.nix | 1 + lib.nix | 5 ++--- package.nix | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index f9a626f..580484d 100644 --- a/flake.nix +++ b/flake.nix @@ -24,6 +24,7 @@ lib = import ./lib.nix { inherit pkgs; + wrapPkg = packages.wrap; }; devShells.default = import ./shell.nix { diff --git a/lib.nix b/lib.nix index 806f52c..340b6ac 100644 --- a/lib.nix +++ b/lib.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: - +{ pkgs, wrapPkg, ... }: { wrap = { @@ -14,7 +13,7 @@ postBuild = '' mv $out/bin/${executable}{,-nowrap} cat << _EOF > $out/bin/${executable} - exec ${./wrap.sh} ${wrapArgs} ${package}/bin/${executable} "\$@" + exec ${pkgs.lib.getExe wrapPkg} ${wrapArgs} ${package}/bin/${executable} "\$@" _EOF chmod a+x $out/bin/${executable} ''; diff --git a/package.nix b/package.nix index bab05e8..f78af06 100644 --- a/package.nix +++ b/package.nix @@ -27,6 +27,7 @@ stdenvNoCC.mkDerivation { homepage = "https://github.com/rti/nixwrap"; license = licenses.mit; maintainers = with maintainers; [ rti ]; + mainProgram = "wrap"; platforms = platforms.linux; }; }