[Nix-dev] Merging fix-style branch into the trunk ?
Nicolas Pierron
nicolas.b.pierron at gmail.com
Mon Feb 23 16:41:22 CET 2009
Hi Nixers,
I have started the fix-style branch a while ago because this may have
created some problems in the main line. The goal of this branch was
to prove us that NixOS can be modular and easier to learn/extend with
only one writing coming from the computer configuration syntax. This
goal of this mail is to ask you if you about complains against merging
this branch into the main line.
The previous evaluation system had the following problems:
1/ Users have to learn all Nix features to patch NixOS and to put
their hands into the code in order to add services or primary
features.
2/ NixOS features are spread over multiple files without any clear links.
1) This point has mainly be solved by introducing the function called
"fixOptionSets" ( pkgs/lib/options.nix ). This function allow users
to write any extra configuration file which can be imported in his own
configuration. This enables devices & services specific
configurations. The other point behind this issue is related to
non-extensible attribute which were mainly contained in
system/system.nix
2) To exemplified this point, I will use the "at" daemon.
- This is an upstart-job, so it as to be registered in
upstart-jobs/default.nix. As it is referred inside the previous file,
it is put inside the upstart-jobs directory even if the "at" daemon is
not directly related to the upstart-job configuration.
- As this daemon may log under different user, it needs a file named
/etc/pam.d/atd, which is generated by /etc/default.nix even if you are
not using this daemon.
- This service requires to have commands registered in the system path
and to have some setuid programs. So it has two line entries in
system/system.nix to specify that.
- Administrator may not want to enable such service, so they are allow
to disable it with an option registered in system/options.nix
On the other hand, as done in the fix-style branch, you have in
upstart-jobs directory ( or in any other directory ) a file which
contains the option declaration (interface), the job definition, the
etc file and the setuid programs. And a reference into
system/options.nix because this file is part of the default choices
offered by NixOS.
This branch is mainly a proof of concept, so all jobs are not
converted yet. The experience was to check that NixOS system can be
split in files which tackle specific issues. There is more work
waiting to be done on this, but we need some work force to do that.
Hopefully, this work can be spread over time because this does not
disturb everything.
Main modifications made in this branch:
- a few upstart-jobs conversion.
- upstart-jobs/default.nix, etc/default.nix are configuration files.
- extensible activation script.
- system parts can be build in multiple files.
- xserver handles multiple .. at the same time: windowsManager
(compiz, wmii, ...), desktopManager (kde, kde 4, gnome, ...)
Do you want me to push these modifications in the main line ?
--
Nicolas Pierron
http://www.linkedin.com/in/nicolasbpierron
- If you are doing something twice then you should try to do it once.
More information about the nix-dev
mailing list