Commit graph

30 commits

Author SHA1 Message Date
06b458ea7a Hard-wrap the README to 80 columns (#12)
The text of this is unchanged **except** I added a sentence saying to please keep the README wrapped to 80 columns. I am proposing this as a style rule (only for Markdown files).o

The reasoning here is that the README is the onboarding information that newcomers to the project need, and it should be readable via as many different approaches as possible.

While many people approach new codebases by browsing the web, some of us still do the old thing of cloning the repo and looking for descriptive files within it, and for those people we should try to work on the widest variety of terminals we can. 80 columns has been a lowest-common-denominator width since the 70s, so it makes a good target for this purpose.

I'm not hurt if people disagree, I just thought I'd offer this :)

Co-authored-by: Jake Hamilton <jake.hamilton@hey.com>
Reviewed-on: #12
Reviewed-by: Jake Hamilton <jake.hamilton@hey.com>
Co-authored-by: Irene Knapp <ireneista@irenes.space>
Co-committed-by: Irene Knapp <ireneista@irenes.space>
2025-10-18 22:25:47 +00:00
0f5182ff0d Module-level assertions (#8)
I had a usecase for assertions in the module system for my [trivial builders PR in tidepool](auxolotl/labs#24), so I added a pretty basic way of defining them.

It's somewhat quick and dirty I feel like, and given lib has hit 1.0 I precautiously added a warning "module assertions are experimental" if a module defines them, which is traced just before checking them. Assertions are not checked if `__module__.check = false`.

I also took the liberty to fixup little things in tests and the module lib (the 3 commits with `fix:`).

Each commit is rather tiny, but I split them up for review. re-formatting is in the last one.

Co-authored-by: austreelis <git@swhaele.net>
Reviewed-on: #8
Reviewed-by: Jake Hamilton <jake.hamilton@hey.com>
Co-authored-by: Austreelis <austreelis@noreply.git.auxolotl.org>
Co-committed-by: Austreelis <austreelis@noreply.git.auxolotl.org>
2025-10-18 22:21:49 +00:00
97e4032e45
docs: migrate lib.types to doc-comments 2025-09-19 07:52:33 +04:00
53890afbd5
docs: migrate lib.strings to doc-comments 2025-09-19 07:52:33 +04:00
f76e162e21
docs: migrate lib.points to doc-comments 2025-09-19 07:52:33 +04:00
efca3387c5
docs: migrate lib.paths to doc-comments 2025-09-19 07:52:33 +04:00
202ceec461
docs: migrate lib.packages to doc-comments 2025-09-19 07:52:33 +04:00
459a42c163
docs: migrate lib.options to doc-comments 2025-09-19 07:52:33 +04:00
a42ea243de
docs: migrate lib.numbers to doc-comments 2025-09-19 07:52:33 +04:00
8f5f211dff
docs: migrate lib.modules to doc-comments 2025-09-19 07:52:33 +04:00
a179065a69
docs: migrate lib.math to doc-comments 2025-09-19 07:52:33 +04:00
0adb3533c1
docs: migrate lib.lists to doc-comments 2025-09-19 07:52:33 +04:00
fca12d06bc
docs: migrate lib.importers to doc-comments 2025-09-19 07:52:33 +04:00
9ba13a521e
docs: migrate lib.generators to doc-comments 2025-09-19 07:52:33 +04:00
99b3d68da8
docs: migrate lib.fp to doc-comments 2025-09-19 07:52:33 +04:00
9858fc1d42
docs: migrate lib.errors to doc-comments 2025-09-19 07:52:33 +04:00
7f56ec4c86
docs: migrate lib.dag to doc-comments 2025-09-19 07:52:33 +04:00
abc36668eb
docs: migrate lib.bools to doc-comments 2025-09-19 07:52:33 +04:00
58c7465dc2
docs: migrate lib.attrs to doc-comments 2025-09-19 07:52:33 +04:00
14074222a8
docs: migrate lib.versions to doc-comments 2025-09-10 05:53:35 +04:00
683b6cb609
chore: define scopes by dirname, not manually
Before this commit, there existed slight confusion between the directory
name and the library scope name. For example, `lib.points.fix` is
defined in `points/default.nix` under an attribute set named `points`.
Theoretically, one could create a new directory, such as `foo`, but name
the library scope `bar`.

With this commit, the library scope is inferred from dirname
automatically. This also has the benefit of slightly reducing nesting
and reducing duplication of data. As a downside, it turns `files`, a
list of paths, into a list of strings. This is necessary because when
paths are parsed in NixLang, they become absolute paths, and so
`builtins.toString ./lists` would become "/home/foo/lib/src/lists",
which is undesirable. This is a downside, because it makes using
filepath LSP (like the one Neovim usually ships with, where it provides
autocomplete for paths) impossible, and so typos become a little easier
to make.

This is necessary for future work on migrating to RFC 145 style
doc-comments. This migration would allow us to build API documentation,
but first, the nesting needs to be removed, because `nixdoc` (an utility
to build Markdown out of doc-comments) doesn't expect it and generates
empty entries.
2025-09-10 05:50:02 +04:00
2af4e9f1d5
feat: add support for cartesian products 2025-09-01 02:43:53 -07:00
c55943c5e8
feat: pass module prefix through meta 2025-08-25 05:44:50 -07:00
137908ce11 test: remove some requirements for merging types
In I605b034fdfc537e84785ce5149e443f54e5d4e3a, we removed some
requirements for merging types - we should write some tests to make sure
that (1) they all work and (2) future updates can't break our merging
again
2025-06-08 11:46:56 +00:00
7b91763656 feat: set default priorities in new types
If we don't specify an option, we can set the priority to be default.
This will allow merged types to override it without manually specifying
it.
2025-06-08 11:46:40 +00:00
1405f5515f feat: remove some requirements for merging types
The type merging code is too restrictive - a bug - since as some types
that specify defaults can't be merged at all even if they should be able
to.

I've made the merging system to allow merging if any of the following
apply:
- Unmergeable properties are unspecified on one side
- Unmergeable properties have different priorities, in which case we
  will take the more important priority - this allows overrides
- Unmergeable properties are the same on both sides, for example this
  lets us specify everything at default priorities and have them merged

Merging each of the problem properties manually also lets us pinpoint
what the issue is and merge them in a nicer way

Change-Id: I605b034fdfc537e84785ce5149e443f54e5d4e3a
2025-06-08 11:46:36 +00:00
7b154aae01 feat: make modules.apply.fixup handle overrides
We're about to add overriding to make it so we can merge more things in
modules. Before using any of these things (although after merging), we
need to strip out the overrides

We can hijack the modules.apply.fixup function to do this, as it is
called in places where things are merged
2025-06-07 15:02:46 +00:00
c95ca1a881 fix: correct typo
There is no "lib.modules.fixup". The best I can tell, this is meant to
be "lib.modules.apply.fixup". Let's make it so
2025-06-07 14:53:03 +00:00
7552ab48bb
docs: update install instructions 2025-03-30 04:10:59 -07:00
ca05619548
chore: extract from labs 2025-03-30 04:09:27 -07:00