[Nix-dev] Re: [Nix-commits] SVN commit: nix - 15750 - NicolasPierron - in nixos/branches/modular-nixos: . hardware hardware/network hardware/network/smc-2632w hardware/network/smc-2632w/firmware hardware/network/smc-2632w/firmware/cis hardware/video hardware/v

Eelco Dolstra e.dolstra at tudelft.nl
Thu May 28 12:00:20 CEST 2009


Hi,

Nicolas Pierron wrote:

> On Thu, May 28, 2009 at 01:03, Eelco Dolstra <e.dolstra at tudelft.nl> wrote:
>> Nicolas Pierron wrote:
>>
>>> Log:
>>> Move hardware modules outside of the module directory because these are modules which should be imported only when you need to support some of them.
>> This doesn't seem like a good idea (and I'd like to revert).  They are modules
>> after all.  If the only reason is that you don't want them imported
>> automatically, then don't have the generator script put them in module-list.nix
>> (just filter out the whole modules/hardware directory).
> 
> I hate exceptions.  

You have an exception either way, since now we have an exception to the NixOS
directory layout (modules go under modules/, except that hardware modules go
under hardware/).  And that's a much more visible exception.

>> But more fundamentally, shouldn't these modules behave like all other modules?
>> That is, that whether they're enabled or disabled is controlled by a config option?
> 
> No, because you will again end up with a catch all section, even if
> this won't be directly put into one file, you will have a huge
> repository and I think that the hardware configuration is a bit
> orthogonal to NixOS which tries to handle the configuration &
> services.  This explain why I haven't added it inside NixOS first but
> inside the configuration repository which seems much more appropriate.

The configuration tree was never intended to be checked out by arbitrary users -
it just contains our configurations (e.g. the TUD buildfarm, my laptop, etc.)
because we have to put them somewhere, and they might also be useful as an
example for others.

Support for hardware is definitely an inherent part of the OS and so belongs in
the NixOS tree.  And the NixOS tree does lots of hardware handling already
anyway (e.g. the udev module loads kernel modules for all supported hardware
automatically).  So treating hardware modules very differently seems an ad hoc
distinction.

> Another argument against that is that you will have to merge too many
> configurations where most of them are just unused.  So this will cost
> you time for nothing good.  Adding a require statement to the
> corresponding hardware seems easy and does not waste your evaluation
> time.

Yes, that's true.  Actually, to turn it around, maybe we should get of some of
the other "enable" options.  I.e. rather than saying services.httpd.enable =
true, you could do a require = [.../httpd.nix] in your configuration.nix.

-- 
Eelco Dolstra | http://www.st.ewi.tudelft.nl/~dolstra/



More information about the nix-dev mailing list