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

Configurable auto-wiring #62

Closed
srid opened this issue Feb 6, 2023 · 2 comments · Fixed by #134
Closed

Configurable auto-wiring #62

srid opened this issue Feb 6, 2023 · 2 comments · Fixed by #134
Labels
enhancement New feature or request

Comments

@srid
Copy link
Owner

srid commented Feb 6, 2023

Currently haskell-flake implicitly sets packages, devShells and checks. Let's call it "auto wiring".

Unless upstream implements it, we can add an haskellProjects.foo.autoWire bool option (default is true) that users can disable if they want to "wire" the flake outputs themselves, eg.:

{
  haskellProjects.foo = {
    ..
    autoWire = false;
  };
  packages.default = config.haskellProjects.foo.output.packages.mypkg;
  devShells.default = config.haskellProjects.foo.output.devShell;
  # Disabling checks temporarily
  checks = config.haskellProjects.foo.output.checks;
}
@srid
Copy link
Owner Author

srid commented Feb 17, 2023

In the context of #84, here's an alternate API:

{
  flake.haskellFlake.autoWire = true;
}

Note: flake.haskellFlake.autoWire operates only on the haskellProject.default project, and it is enabled by default. Therefore, by default, outputs are auto-wired for the "default" project. But other projects are not injected into the flake outputs (in contrast to current behaviour); the user has to manually do that. This can be desirable behaviour as it removes the naming hack (haskellProjects.foo -> packages.foo-whatever) and forces the user to come up with a good name for their package output.

@srid
Copy link
Owner Author

srid commented Feb 17, 2023

Or:

{  # In perSystem
  haskell-flake = {
    projects.default = { .. };
    autoWire = true;
  };
}

(Assuming it is possible to wire flake outputs from inside of a perSystem config .... if it even makes sense 🤔)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant