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

Bit Shift bitshift at bigmacintosh.net
Tue Jul 22 17:38:21 CEST 2014


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



More information about the nix-dev mailing list