Commit graph

9 commits

Author SHA1 Message Date
Matt Sturgeon
9487403532
modules/context: flake option, provides access to our flake 2024-12-23 12:18:06 +00:00
Matt Sturgeon
8c3d521bff
modules: move nixpkgs module to top-level modules
Make `pkgs` available to files submodules by passing _all_ module args
through. We already did this for `specialArgs`.
2024-09-27 09:30:12 +01:00
Matt Sturgeon
6da94195c2
modules/misc: include assertions and meta modules in the repo
Based on the modules we previously imported from NixOS.

This will allow us to drop the `defaultPkgs` specialArg and avoids
needing the proposed `pkgsPath` specialArg.
2024-09-24 12:49:28 +01:00
Austin Horstman
1c9ba58aef
modules: cleanup with lib 2024-09-03 22:12:33 -05:00
Matt Sturgeon
c4fcbb0dcf
modules/context: add isTopLevel option 2024-08-20 22:02:29 +01:00
Matt Sturgeon
04a255ed7e
modules/context: init with isDocs
Replaced the `isDocs` specialArg added in #1807 with an internal module
option.

We should only use `specialArgs` when absolutely necessary, a module or
`_module.args` is preferred, but those aren't available until `config`
is evaluated so they can't be used for `imports`.

The main problem with `specialArgs` is it makes our modules less
portable.

Luckily that shouldn't be an issue for these context flags.
2024-07-06 11:47:41 +01:00
Matt Sturgeon
87f50db84d
modules/nixpkgs: don't set args.lib
`lib.evalModules` always includes `lib`, `config`, `options`, &
(configured) `specialArgs` in the (final) `specialArgs`[1].

Therefore, setting `_module.args.lib` has no effect.

[1]: 329d232802/lib/modules.nix (L233)
2024-07-02 20:26:55 +01:00
Matt Sturgeon
11df0d6c9e
modules: use assertions module from nixpkgs
It is essentially identical to our `warnings` module.
2024-07-02 19:58:30 +01:00
Matt Sturgeon
d2afb176ff
modules: refactor module bootstrapping
Let's simplify things by defining all modules in `./plugins`, `./modules`
and `./wrappers/modules`.

Instead of currying `pkgs` into a bootstrapping module, we can require
`defaultPkgs` be provided as a special arg.

This refactor allows us to completely remove `flake-modules/modules.nix`!
2024-07-02 19:58:30 +01:00