Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nix-community/haumea
Filesystem-based module system for Nix [maintainer=@figsoda]
https://github.com/nix-community/haumea
auto flake flakes hierarchy import nix visibility
Last synced: 3 months ago
JSON representation
Filesystem-based module system for Nix [maintainer=@figsoda]
- Host: GitHub
- URL: https://github.com/nix-community/haumea
- Owner: nix-community
- License: mpl-2.0
- Created: 2023-04-01T00:50:18.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-01T05:55:45.000Z (7 months ago)
- Last Synced: 2024-04-15T11:59:35.983Z (7 months ago)
- Topics: auto, flake, flakes, hierarchy, import, nix, visibility
- Language: Nix
- Homepage: https://nix-community.github.io/haumea/
- Size: 96.7 KB
- Stars: 240
- Watchers: 6
- Forks: 4
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-nix - haumea - Filesystem-based module system for the Nix language similar to traditional programming languages, with support for file hierarchy and visibility. (Development / Discovery)
README
# Haumea
Filesystem-based module system for Nix
Haumea is not related to or a replacement for NixOS modules.
It is closer to the module systems of traditional programming languages,
with support for file hierarchy and visibility.In short, haumea maps a directory of Nix files into an attribute set:
From
To
```
├─ foo/
│ ├─ bar.nix
│ ├─ baz.nix
│ └─ __internal.nix
├─ bar.nix
└─ _utils/
└─ foo.nix
```
```nix
{
foo = {
bar = <...>;
baz = <...>;
};
bar = <...>;
}
```
Haumea's source code is hosted on [GitHub](https://github.com/nix-community/haumea)
under the [MPL-2.0](http://mozilla.org/MPL/2.0) license.
Haumea bootstraps itself. You can see the entire implementation in the
[src](https://github.com/nix-community/haumea/tree/main/src) directory.## Why Haumea?
- No more manual imports
Manually importing files can be tedious, especially when there are many of them.
Haumea takes care of all of that by automatically importing the files into an attribute set.- Modules
Haumea takes inspiration from traditional programming languages.
Visibility makes it easy to create utility modules,
and haumea makes self-referencing and creating fixed points a breeze
with the introduction of `self`, `super`, and `root`.- Organized directory layout
What you see is what you get.
By default[^1], the file tree will look exactly like the resulting attribute set.- Extensibility
Changing how the files are loaded is as easy as specifying a `loader`,
and the `transformer` option makes it possible to extensively manipulate the tree.[_➔ Getting Started_](https://nix-community.github.io/haumea/intro/getting-started.html)
[^1]: Unless you are doing transformer magic