Hi John,

I guess the reason you are not receiving many answers is that your question highlights some misconceptions, and some design issues with nix.

There does not exist any declarative configuration file for user environments. /etc/nixos/configuration.nix is amazing, but has not been parted to user environments. Installing user packages is done with nix-env, in an imperative fashion, and updates are based on packages names (nix-env -u) as explained on the [wiki]. Please see the discussion on [GitHub](1) about that precise topic.

To get declarative user environments, you can look at the pull-request for [NixUP] (nix user profiles), or use a trick to manage packages declaratively in a custom environment. The [wiki] has such an example. I personally maintain a [~/.nixpkgs/packages.nix] that I edit, install and activate with the following one-liner. The command replaces all the installed packages with the given ones (-ir). I could alias it to nixuser-rebuild ;-).

vim ~/.nixpkgs/packages.nix && nix-env -f ~/.nixpkgs/packages.nix -ir -Qk && i3-msg restart

NixUP and/or the coming update to nix (1.12) /should/ make this management easier.

I hope this makes it clearer!

Regards,

-- Layus.


[NixUP]: https://github.com/NixOS/nixpkgs/pull/9250
[1]: https://github.com/NixOS/nixpkgs/issues/1750
[wiki]: https://nixos.org/wiki/Howto_keep_multiple_packages_up_to_date_at_once [~/nixpkgs/packages.nix]: https://gist.github.com/layus/427356ab4e7f46565d984686a311ca91#file-packages-nix

On 03/05/17 08:29, John Ramsden wrote:
I've been looking for some information about how exactly the $HOME/.nixpkgs/config.nix file works. How exactly is it intended to be used? Up until now I've been managing my entire system from /etc/nixos, but it would be nice to have a place where I can add something that happens only to a single user. For example, setting up dotfiles, or use our services. Can the config.nix file be used for that? Is it effectively a /etc/nixos/configuration.nix that is intended to be used for a single user?

I have found little bits of information about it here and there, for example in the nix pills. but nothing that really explains what it is used for in detail. Could someone point me where I can find this information?


_______________________________________________
nix-dev mailing list
[email protected]
https://mailman.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to