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; }; }