Skip to content

feat(lib): expose internal helpers#144

Merged
zimbatm merged 1 commit intonumtide:mainfrom
moduon:lib-more-useful
Feb 18, 2026
Merged

feat(lib): expose internal helpers#144
zimbatm merged 1 commit intonumtide:mainfrom
moduon:lib-more-useful

Conversation

@yajo
Copy link
Contributor

@yajo yajo commented Feb 17, 2026

A few internal helpers are actually useful for others.

$ nix eval .#lib --apply builtins.attrNames

# Before
[ "__functor" "filterPlatforms" "importDir" "mkBlueprint" "tests" "tryImport" "withPrefix" ]

# After
[ "__functor" "entriesPath" "filterPlatforms" "importDir" "importTomlFilesAt" "mkBlueprint" "mkBlueprint'" "mkEachSystem" "optionalPathAttrs" "tests" "tryImport" "withPrefix" ]

Expose them, so they can be reused:

  • entriesPath: Helper to get the path to entries/files in a directory
  • importTomlFilesAt: Imports TOML files from a specified directory and converts them to Nix attribute sets, with automatic name normalization
  • mkBlueprint': Internal implementation of mkBlueprint that creates the complete flake structure with all outputs (packages, configurations, modules, etc.)
  • mkEachSystem: Creates a function that evaluates expressions per-system, handling cross-platform builds and system-specific configurations
  • optionalPathAttrs: Returns attributes from a path if it exists, otherwise returns an empty set

@moduon MT-1075

A few internal helpers are actually useful for others.

Expose them, so they can be reused.
@yajo
Copy link
Contributor Author

yajo commented Feb 18, 2026

Maybe mkBlueprint' could be kept internal.. wdyt?

@zimbatm
Copy link
Member

zimbatm commented Feb 18, 2026

eh, why not

@zimbatm zimbatm merged commit 06ee719 into numtide:main Feb 18, 2026
16 checks passed
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.

2 participants

Comments