[Nix-dev] Configuring Packages installed with `nix-env` is impossible?

Mateusz Kowalczyk fuuzetsu at fuuzetsu.co.uk
Wed Jul 30 20:20:26 CEST 2014


On 07/22/2014 05:38 PM, Bit Shift wrote:
> On Tue, Jul 22, 2014 at 7:58 AM, Roger Qiu <roger.qiu at polycademy.com> wrote:
>  > Also when I do this:
>  >
>  > $ echo $NIXPKGS_CONFIG
>  > /etc/nix/nixpkgs-config.nix
>  >
>  > Is that meant to be correct. I thought it should be 
> `~/.nixpkgs/config.nix`?
>  >
>  > Thanks,
>  > Roger

My $NIXPKGS_CONFIG also points there even though ~/.nixpkgs/config.nix
is used as expected so I wouldn't worry about it too much.

>  >
>  > On 22/07/2014 4:56 PM, Roger Qiu wrote:
>  >>
>  >> Thanks that's the right way.
>  >>
>  >> Interestingly the `~/.nixpkgs` folder is not installed by default.
>  >>
>  >> Thanks,
>  >> Roger
>  >>
>  >> On 22/07/2014 4:53 AM, Bit Shift wrote:
>  >>>
>  >>> On 21/07/2014 05:30, Roger Qiu wrote:
>  >>>>
>  >>>> Hello,
>  >>>>
>  >>>> The NixOS manual specifies 2 ways of installing packages, the
>  >>>> declarative style through configuration.nix + nixos-rebuild switch, or
>  >>>> the per-user style via `nix-env -i`.
>  >>>>
>  >>>> While you can configure the package options inside configuration.nix,
>  >>>> how does one configure packages when they are installed on a per-user
>  >>>> style.
>  >>>>
>  >>>> For example if I install NGINX or PHP with `nix-env -i nginx` or
>  >>>> `nix-env -i php`, I get NGINX and PHP on my particular 
> `~/.nix-profile`.
>  >>>>
>  >>>> How do I change the configuration inside nginx.conf or php.ini or
>  >>>> php-fpm.ini?
>  >>>>
>  >>>> There doesn't seem to be any way to do so. The `~/.nix-profile` is
>  >>>> read-only.
>  >>>>
>  >>>> What if there was a per-user configuration.nix which was able to
>  >>>> actually configure the packages, or maybe the options could be 
> specified
>  >>>> on the command line as part of `nix-env`.
>  >>>>
>  >>>> Otherwise, there doesn't seem to be any way of effectively using
>  >>>> complicated packages on a per-user basis such NGINX, Apache, PHP and
>  >>>> every other package that requires configuration.
>  >>>>
>  >>>> Thanks,
>  >>>> Roger
>  >>>>
>  >>>
>  >>> nix-env -i (or preferably -iA for no ambiguity) will use the 
> function you
>  >>> define for the packageOverrides attr in ~/.nixpkgs/config.nix and 
> install
>  >>> the new/changed derivations it results in.
>  >>>
>  >>> It's already explained in [1], so I'll refrain from trying to 
> rephrase it
>  >>> myself and probably distort some of the meaning.
>  >>>
>  >>> -B
>  >>>
>  >>> [1]:
>  >>> 
> https://nixos.org/wiki/Nix_Modifying_Packages#Overriding_Existing_Packages
>  >>
>  >>
>  >
>  > --
>  > Founder of Polycademy & SnapSearch
>  > http://polycademy.com
>  > https://snapsearch.io
>  > +61420925975
>  >
> 
> That I don't know. It's certainly set to that on my box, while stuff in 
> ~/.nixpkgs/config.nix works correctly, but I'm not nearly well-versed 
> enough in Nix to know what the purpose of that environment variable 
> actually is.
> 
> -B
> 
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
> 


-- 
Mateusz K.


More information about the nix-dev mailing list