reuse(devLib): expose extended lib by default and use an overlay to extend it#1927
Draft
ju1m wants to merge 1 commit into
Draft
reuse(devLib): expose extended lib by default and use an overlay to extend it#1927ju1m wants to merge 1 commit into
lib by default and use an overlay to extend it#1927ju1m wants to merge 1 commit into
Conversation
… extend it +reuse: exposing the extended `lib` by default enables to reuse it in modules evaluated by `pkgs.testers.runNixOSTest` in `projects/tests.nix`, otherwise `lib` given to modules when testing is Nixpkgs' `pkgs.lib`. +clarity: being able to factorize code in a `lib`rary is much easier to check, maintain and develop than having to manage multiple copies of the same code. +standardization: having some code in a `lib`rary nudges more to use it than if it would require to copy, since it's already an explicitly shared pattern. +customizability: using an overlay enables to customize `lib`'s sub attrs (eg. adding types to `lib.types`). -portability: using a custom `lib` specific to NGIpkgs means the code is less portable, eg. pushing it into Nixpkgs or NixOS means pushing the part of `lib` it depends on with it, or to copy it in the package or module. -installability: using a custom `lib` specific to NGIpkgs means the modules must be imported with that `lib` by users, which may not be obvious.
8 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
+reuse: exposing the extended
libby default enables to reuse it in modulesevaluated by
pkgs.testers.runNixOSTestinprojects/tests.nix,otherwise
libgiven to modules when testing is Nixpkgs'pkgs.lib.+clarity: being able to factorize code in a
libraryis much easier to check, maintain and develop
than having to manage multiple copies of the same code.
+standardization: having some code in a
librarynudges more to use it than if it would require to copy,
since it's already an explicitly shared pattern.
+customizability: using an overlay enables to customize
lib'ssub attrs (eg. adding types to
lib.types).-portability: using a custom
libspecific to NGIpkgsmeans the code is less portable, eg. pushing it into Nixpkgs or NixOS
means pushing the part of
libit depends on with it,or to copy it in the package or module.
-installability: using a custom
libspecific to NGIpkgsmeans the modules must be imported with that
libby users,which may not be obvious.