Commit graph

14 commits

Author SHA1 Message Date
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