Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nix flake refactor: avoid with lib; & use lib.optional* #2813

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

toastal
Copy link
Contributor

@toastal toastal commented Jan 30, 2025

Upstream Nixpkgs has been pushing the style of removing with lib; with the reasoning of clarity around where variables in scope come that hurt readability & static analysis1.

While on the topic of lib, introduce lib.optional & lib.optionalString in a few more places to tidy up the code while using common library patterns.


Also has been open @ https://gitlab.com/StevenBlack/hosts/-/merge_requests/2

Footnotes

  1. https://nix.dev/guides/best-practices#with-scopes

Upstream Nixpkgs has been pushing the style of removing ``with lib;``
with the reasoning of clarity around where variables in scope come that
hurt readability & static analysis[*].

While on the topic of ``lib``, introduce ``lib.optional`` &
``lib.optionalString`` in a few more places to tidy up the code while
using common library patterns.

.. [*] https://nix.dev/guides/best-practices#with-scopes

Format: text/x-rst
@toastal toastal force-pushed the nix-flake-avoid-with-lib branch from 742a197 to 0a64bfb Compare February 1, 2025 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant