Skip to content

How to make default.nix directory import work properly? #43

@emanueljg

Description

@emanueljg

I want Haumea to automatically convert directoryToImport imports to directoryToImport.default imports IF the directory contains a default.nix.

Reason is as follows:

Let's say I have two types of directories:

  1. Directories without default.nix in them
  2. Directories withdefault.nix in them.

In the first scenario, it's a case where I want all files in the dir without question (which is why I started using Haumea in the first place). But the second scenario is more for when I want a more portable directory structure and/or want to be more precise in what modules I want to import in the dir (example in this case being NixOS configuration). This second scenario becomes a bit clunky to solve. I have to write directoryToImport.default to actually import the directory, which is unneccessary, ugly and removes the dynamic ability in going back and forth between importing a loose nix file and a directory without changing its file path.

How do I do this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions