Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/davhau/flake-parts-auto

Auto import and expose modules in your flake
https://github.com/davhau/flake-parts-auto

Last synced: 6 days ago
JSON representation

Auto import and expose modules in your flake

Awesome Lists containing this project

README

        

# Flake Parts Auto

# Why?
flake-parts uses module system, which allows great modularization of your flake.

# How?
See `./examples/mkFlake/flake.nix` and `./examples/importModules/flake.nix`. This library takes a `modulesDir` and imports and exports modules automatically from the following paths:

The modules defined in `//.nix` are exported as `modules..`

To be compatible with existing module systems, these `moduleKind` are treated specially:

- `/flake-parts/.nix` is exported to `flakeModules.` for [flake-parts](https://github.com/hercules-ci/flake-parts) compatibility.
- `/nixos/.nix` is exported to `nixosModules.` for nixpkg compatibility.
- `/darwin/.nix` is exported to `darwinModules.` for nixpkg compatibility.

# Disadvantages:
- There is no way to specify which modules should not be imported/exported, so all modules are both imported and exported. To customize this you have to adapt the logic in `./modules/flake-parts/all-modules.nix`