Skip to content

Can't make nix imports dynamically generated modules. #14103

@orzklv

Description

@orzklv

Describe the bug

Assuming I have many of these modules in my NixOS configuration which follow almost the same configuration pattern:

Screenshots

Image

Image

I wanted to write a module that would dynamically generate modules for those apps from a list like this:

Image

Steps To Reproduce

  1. Clone https://github.com/kolyma-labs/instances/tree/dynamic-web
  2. Examine the last commit for more context
  3. nix flake check

Expected behavior

Generate and import modules, so they would create configurations I mentioned at the top screenshots.

Metadata

nix-env (Determinate Nix 3.11.2) 2.31.1

Additional context

Everything is here: https://github.com/kolyma-labs/instances/tree/dynamic-web

Checklist


Add 👍 to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions