The wrapper derivation approach works nicely, thanks!

I'm trying to understand how to achieve the same with stackable wrappers,
but not sure how. The examples in https://github.com/NixOS/ni
xpkgs/pull/24858 are using wrapQtProgam and wrapPythonPrograms. In both
cases there is a way to extend the created wrapper, you can set
`makeWrapperArgs` for wrapPythonPrograms, or you can pass extra arguments
to wrapQtProgram. But okular uses kdeWrapper, which doesn't seem to offer a
way to extend the created wrapper. Is it really not possible to extend the
wrapper created with kdeWrapper, or am I missing something?

On Fri, May 5, 2017 at 4:12 PM, Guillaume Maudoux (Layus) <
layus...@gmail.com> wrote:

> 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 
> listnix-...@lists.science.uu.nlhttps://mailman.science.uu.nl/mailman/listinfo/nix-dev
>
> ​
>
_______________________________________________
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to