-
-
Notifications
You must be signed in to change notification settings - Fork 296
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib: include standalone wrapper in top-level
lib
- Defragment lib-related flake-modules - Expose the standalone-wrapper functions in the `lib`
- Loading branch information
1 parent
86a4021
commit 7aa0fa3
Showing
7 changed files
with
39 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,32 @@ | ||
{ | ||
self, | ||
config, | ||
lib, | ||
withSystem, | ||
getSystem, | ||
... | ||
}: | ||
{ | ||
flake.lib = lib.genAttrs config.systems ( | ||
lib.flip withSystem ({ pkgs, ... }: import ../lib { inherit pkgs lib; }) | ||
); | ||
perSystem = | ||
{ self', pkgs, ... }: | ||
{ | ||
# `helpers` is used throughout the flake modules | ||
_module.args = { | ||
inherit (self'.lib) helpers; | ||
}; | ||
|
||
legacyPackages = { | ||
# Export nixvim's lib in legacyPackages | ||
lib = import ../lib { | ||
inherit pkgs lib; | ||
flake = self; | ||
}; | ||
|
||
# Historically, we exposed these at the top-level of legacyPackages | ||
# TODO: Consider renaming the new location, and keeping the old name here? | ||
inherit (self'.legacyPackages.lib) makeNixvimWithModule makeNixvim; | ||
}; | ||
}; | ||
|
||
# Also expose `legacyPackages.<system>.lib` as `lib.<system>` | ||
flake.lib = lib.genAttrs config.systems (system: (getSystem system).legacyPackages.lib); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
# Args probably only needs pkgs and lib | ||
{ | ||
flake, | ||
pkgs, | ||
lib ? pkgs.lib, | ||
_nixvimTests ? false, | ||
... | ||
}@args: | ||
{ | ||
lib.fix (self: { | ||
# Add all exported modules here | ||
check = import ./tests.nix { inherit lib pkgs; }; | ||
helpers = import ./helpers.nix (args // { inherit _nixvimTests; }); | ||
} | ||
|
||
# TODO: Consider renaming these? | ||
makeNixvimWithModule = import ../wrappers/standalone.nix pkgs flake; | ||
makeNixvim = module: self.makeNixvimWithModule { inherit module; }; | ||
}) |