Commit graph

5 commits

Author SHA1 Message Date
Matt Sturgeon
4e5bd1d79b
lib: segregate and deprecate functions that need pkgs
Splits everything that depends on a `pkgs` instance into an optional
attrs, allowing `helpers.nix` to be bootstrapped without `pkgs`.

This required some refactoring:
- `modules.specialArgs` is only available when `pkgs` is used
- `modules.specialArgsWith` now requires `defaultPkgs` be provided
- `builders.*` now have `*With` variants that take `pkgs` as an argument
  and a `withPkgs` function that returns the old interface
- Had to define the fixed part of `builders` outside the attrs for now,
  to avoid infinite recursion.
- The old `builders` are now deprecated, and print a warning when
  evaluated
- `withOptoinalFns` was introduced to merge the optional attrs into the
  final lib.
2024-09-13 19:05:26 +01:00
Stanislav Asunkin
c9a6912be5 modules/files: fix creating configs of vim type 2024-07-19 14:45:34 +03:00
Matt Sturgeon
a6cc4c6c33
modules/files: format files submodule output
Instead of `pkgs.writeText`, use `helpest.writeLua` to ensure the file
is formatted with stylua.
2024-07-07 16:44:17 +01:00
Matt Sturgeon
086873bed9
modules: refactor extraFiles
Moved `extraFiles` from `modules/output.nix` into its own file `modules/files.nix`.

Users should now assign text to a `text` attribute, however they could
also assign a file path to a `source` attribute instead.

The old method of directly assigning a string still works, and is
coerced to the new type along with a deprecation warning.
2024-07-07 16:42:47 +01:00
Matt Sturgeon
f5ba05ec82
modules/files: move submodule to its own file 2024-07-05 17:21:56 +01:00