mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
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.
This commit is contained in:
parent
f47e8f8f79
commit
4e5bd1d79b
12 changed files with 165 additions and 84 deletions
|
@ -23,7 +23,10 @@ in
|
|||
default = { };
|
||||
type = types.submoduleWith {
|
||||
shorthandOnlyDefinesConfig = true;
|
||||
specialArgs = config.lib.nixvim.modules.specialArgsWith { darwinConfig = config; };
|
||||
specialArgs = config.lib.nixvim.modules.specialArgsWith {
|
||||
defaultPkgs = pkgs;
|
||||
darwinConfig = config;
|
||||
};
|
||||
modules = [
|
||||
./modules/darwin.nix
|
||||
../modules/top-level
|
||||
|
|
|
@ -22,7 +22,10 @@ in
|
|||
default = { };
|
||||
type = types.submoduleWith {
|
||||
shorthandOnlyDefinesConfig = true;
|
||||
specialArgs = config.lib.nixvim.modules.specialArgsWith { hmConfig = config; };
|
||||
specialArgs = config.lib.nixvim.modules.specialArgsWith {
|
||||
defaultPkgs = pkgs;
|
||||
hmConfig = config;
|
||||
};
|
||||
modules = [
|
||||
./modules/hm.nix
|
||||
../modules/top-level
|
||||
|
|
|
@ -23,7 +23,10 @@ in
|
|||
default = { };
|
||||
type = types.submoduleWith {
|
||||
shorthandOnlyDefinesConfig = true;
|
||||
specialArgs = config.lib.nixvim.modules.specialArgsWith { nixosConfig = config; };
|
||||
specialArgs = config.lib.nixvim.modules.specialArgsWith {
|
||||
defaultPkgs = pkgs;
|
||||
nixosConfig = config;
|
||||
};
|
||||
modules = [
|
||||
./modules/nixos.nix
|
||||
../modules/top-level
|
||||
|
|
|
@ -19,7 +19,9 @@ let
|
|||
mod
|
||||
./modules/standalone.nix
|
||||
];
|
||||
inherit extraSpecialArgs;
|
||||
extraSpecialArgs = {
|
||||
defaultPkgs = pkgs;
|
||||
} // extraSpecialArgs;
|
||||
};
|
||||
inherit (evaledModule.config) enableMan finalPackage printInitPackage;
|
||||
in
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue