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 _______________________________________________ nix-dev mailing list [email protected] http://lists.science.uu.nl/mailman/listinfo/nix-dev
