[Nix-dev] Re: Managing users, configuration files and filesystem mounts.

Lluís Batlle viriketo at gmail.com
Fri Feb 5 20:52:50 CET 2010


2010/2/5 Jason Dusek <jason.dusek at gmail.com>:
> 2010/02/05 Ludovic Courtès <ludo at gnu.org>:
>> Jason Dusek <jason.dusek at gmail.com> writes:
>> > I am curious as to how Nix manages users and groups outside
>> > of NixOS.
>
>  Where can I browse the NixOS specific packages? I poked around
>  under `http://nixos.org/releases/' but have not found them.
As you know, the useful result of nix expressions are 'derivations',
and in the case of nixpkgs, the derivations are thought coinciding
with what other software installation systems call 'packages'.
In the case of nixos, I find it harder to name the nix derivations
there "packages". You will find the derivation of the avahi start
script, the derivation involved in producing the /etc/passwd file, the
derivation producing the /etc/resolv.conf, the derivation producing
the initrd image, ...
And, important, the derivation of the "activation script". That script
puts whatever needed outside of the store, so the system works. That
makes a strong usage of the other derivations of nixos, of course. For
example this is what ends up *manipulating* the /etc/passwd file so it
has all the users the nixos modules requested (keep on reading, about
nixos modules).

How the nix expressions in nixos map to file derivations, you will
find that in the nixos manual, namely through a nix abstraction we
call "nixos modules". A nixos module will define some attribute sets,
receiving some others, and will be evaluated so from it can result
multiple derivations. Those derivations may come not only from a
single module, but from more than one. So, the "avahi" and the
"vsftpd" modules both contribute to the derivation producing the
/etc/passwd file (both define their users). And the result of the
"avahi" nixos module is not a single derivation, but a contribution to
many: the users, the init script, maybe some files at /etc related to
avahi, adding a kernel module, ...

>  It sounds like users are managed in NixOS but when using Nix
>  overlayed with Ubuntu or something else, you must manage users
>  outside of Nix. Is that correct?
Yes



More information about the nix-dev mailing list