Re: [Nix-dev] Extend wrapper created with makeWrapper

2017-05-07 Thread José Luis Lafuente
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


[Nix-dev] Extend wrapper created with makeWrapper

2017-05-05 Thread José Luis Lafuente
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@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] With-expressions question

2017-03-23 Thread José Luis Lafuente
Recently I was having a weird error running nixos-rebuild. I added some
packages to systemPackages and I was getting this error:

cannot coerce a set to a string, at
/etc/nixos/nixpkgs/lib/strings.nix:442:44

After some debugging I found that the guilty was the boot package, but I
needed some time to understand why. In my configuration.nix I have this:

environment.systemPackages = with pkgs; [
  .
  boot
];

But 'boot' refers to the option 'boot', not the package 'boot'. For me,
that behavior is confusing (at least in the programming languages I know
the inner scope variables shadow the ones on the outer scope).
In my example, is there a way to make 'boot' refer to 'pkgs.boot'? or a way
of getting a warning on this case?

Regards,
Jose Luis
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev