Open roberth opened 2 years ago
archetype
Nix already comes with a fair share of obscure terms (derivation, instantiation, attribute set, channel), but NixOS has somehow managed to keep that down: there's basically just options, modules and types (let's ignore NIXOS_LUSTRATE
for a moment here ;).
I'm sure this is subjective, but "archetype" (while being perfectly accurate, with access to a dictionary) feels really obscure. If the Nix/NixOS profile clash is a problem (personally I've never even realised this), I'd suggest to think of something more common. Maybe preset or template.
Template is also taken, but preset is a good candidate. It focuses more on the role of the module than how they're implemented, which is good. It's less differentiated from default which already has a specific meaning in modules but that could be a good thing as well, as they are closely related concepts.
Project description
Goals:
NixOS has its own definition for "profile", which is not to be confused by Nix's definition of "profile". Let's start by renaming "profile" to "archetype" to solve the ambiguity. EDIT: "preset" may be an even better term.
An archetype module is a module that contains configuration that goes into effect unconditionally. This is in contrast with most other modules, whose functionality is gated behind an "enable" option and a
config = mkIf cfg.enable
or similar. This is also in contrast with a "configuration module" which is managed by the user and is typically not intended for reuse (although I wouldn't complain if someone didn't call their reusable configuration module an archetype module).Note that despite being classifiable by technical-ish means, these definitions do not exist within the implementation of the module system. They're entirely for us humans to characterize what is the purpose of a module.
Proposal:
nixos/modules/archetypes
and move all modules that consist of unconditionalconfig
to this directory.config
, if the "options" logic can exist as regular modules without the unconditional config.Future work:
minimal
,desktop
,container
, etc. I do not have an opinion on what should go where. Let's not blow up the scope of this issue. Step by step.