Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One module eval per wrapper #16

Open
viperML opened this issue Mar 7, 2024 · 3 comments
Open

One module eval per wrapper #16

viperML opened this issue Mar 7, 2024 · 3 comments

Comments

@viperML
Copy link
Owner

viperML commented Mar 7, 2024

Thinking about the current implementation of wrapper-manager, maybe it is better to have one lib.evalModules per wrapper, instead of a single one (like the current implementation).

The problems it would solve:

  • Threading one wrapper to another (for example, wrapper B includes A, which is also a wrapper) This can be done with config., nevermind
  • Easily create wrappers for one-off things, like programs.<name>.package options from NixOS.

What it could make easier:

  • Integration with the splicing of nixpkgs (to allow for cross-compilation etc)
    (But perhaps can be done with the current impl)

As for the negatives:

  • Maybe a negative performance impact, in cpu cycles or memory (to be measured)
@nrabulinski
Copy link
Contributor

I think the best way is to have the current API as is but also provide a convenience function which evals a single wrapper type and returns the wrapped package

@SebastianStork
Copy link

So a more convenient way of doing this?

(wrapper-manager.lib {
    inherit pkgs;
    modules = [
        {
            wrappers.hello = {
                basePackage = pkgs.hello;
                flags = ["--help"];
            };
        }
    ];
}).config.wrappers.hello.wrapped

Or am I misunderstanding this?

@viperML
Copy link
Owner Author

viperML commented May 7, 2024

yes

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

No branches or pull requests

3 participants