[Nix-dev] Extend wrapper created with makeWrapper

Guillaume Maudoux (Layus) layus.on at gmail.com
Fri May 5 16:12:58 CEST 2017


Stackable wrappers are implemented in 
https://github.com/NixOS/nixpkgs/pull/24858, but you will need to wait 
for that package to land in master, and then get included in some 
channel :-).

You can also create a trivial wrapper derivation:

|# file ~/.nixpkgs/config.nix { pkgs, ...}: { packageOverrides = super: 
rec { customOkular = pkgs.writeScriptBin "okular" '' #!/usr/bin/env bash 
export MYVAR=something exec ${pkgs.okular}/bin/okular "$@" ''; ... |

and then nix-env -iA nixos.customOkular :-).

— Layus.

On 05/05/17 15:02, José Luis Lafuente wrote:

> Hi,
>
> I want to override an existing package to use it locally. I would like 
> to just set an environment variable before the program is executed, 
> but the derivation is using `wrapProgram`, so there is already a 
> wrapper for the program. Is possible to override the derivation to add 
> another environment variable to the wrapper? The derivation I want to 
> modify is okular 
> (https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/kde/okular.nix) 
>
>
> Thanks in advance,
> José Luis
>
>
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> https://mailman.science.uu.nl/mailman/listinfo/nix-dev

​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.science.uu.nl/pipermail/nix-dev/attachments/20170505/21cfd885/attachment.html>


More information about the nix-dev mailing list