Hey there everyone! I am excited to announce my request for the adoption of a new standalone Nix library: Aux Lib.
What is Aux Lib?
This library is a full recreation of Nixpkgs’ library, but has zero dependencies. It operates on pure Nix concepts and is intended to be used as a foundational piece to support the creation of more complex structures such as package sets and operating systems. A few key features of the library include:
- Module system
- Library extensions
- DAG support
- Normalized naming and organization using namespaces
I have tried to build this library in a way that is as intuitive as possible for people to use. Rather than slapping everything on the root attribute set, everything is contained within relevant namespaces. This means that any time you want to work with a string, you know that you’ll find your helper in lib.strings.*
. In addition to this organization, common patterns have been standardized to make it (hopefully) easier for users to find what they are looking for. Validation logic, for example, is contained within a validate
attribute set under the relevant namespace such as lib.strings.validate.*
to allow for performing different validations on a particular data type.
The module system has also been ported, but contains several distinct changes which will make it less confusing for users.
- Renaming module
imports
toincludes
so it does not collide with the actualimport
keyword - Renaming module
disabledModules
toexcludes
to match - Making it clear that certain things are internal to Aux Lib using
__double_underscores__
, which should make it distinguishable from Nix builtins which use only__prefixed_underscore
- Directed acyclic graph support ported from Home-Manager for more expressive and complex structures
- Normal modules do not support shorthand syntax which should help users understand that their system configuration is in fact a module rather than some json-like config file
- Module arguments are now dynamically supplied so you no longer have to add
...
- Dynamic and static module arguments are now distinguished as
config.__module__.args.dynamic
andconfig.__module__.args.static
rather than the priorconfig._module.args
+specialArgs
combination
What is Aux Lib not?
Notably, Aux Lib only operates on pure Nix concepts. There are no mentions of a package, package metadata, builders, etc. This is intentional as it allows the library to remain independent of a particular package set. These concepts can be built atop this library in another project such as Aux Foundation or Aux Tidepool and should not be included in Aux Lib itself.
Additionally, Aux Lib is not indented to answer every problem. The scope of the library has been trimmed down from what Nixpkgs offers with the intent to simplify its use and maintenance, realizing that most of the time we do not need all of the extra pieces. Any additions to Aux Lib should be thoughtfully considered and care should be taken to not bloat the library, possibly making it harder for users to find what they are looking for or increasing evaluation time.
Adoption
In order for this project to move onto its next phase, pulling it out of Aux Labs, it needs a proper home and team responsible for its upkeep and use. I believe that @sig_core is the right place for this project as it is a central point from which all of our other projects can/will consume. As SIG Core is intended to manage core projects such as the core package set, I believe that the library enabling that package set also falls under its domain. To proceed with this process we require the owners of SIG Core to accept this adoption proposal and work together to create a transition plan. I believe @isabel is the touch-point here
Before accepting this proposal, please take a look at the code in the repository linked at the beginning of this post. We do not have any outstanding known bugs (other than one recently discovered by @austreelis), but the library will require some documentation and testing love. Currently about half of the project has tests and while there is code documentation it is rather bare-bones. This will be a collaboration effort with @sig_documentation to make the project ready for end-users. @coded and @minion can be reached for input on documentation.
Anything I missed?
This has been in the works for a little while and I may have missed some things in this post. If so, please feel free to ask questions or let me know! I am excited to finally have this library moving forward now that it has been proven to function well within Aux Foundation and Aux Tidepool for a few months.