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

More convenient way to enable withIde from flake #168

Open
bgamari opened this issue Jun 7, 2023 · 10 comments
Open

More convenient way to enable withIde from flake #168

bgamari opened this issue Jun 7, 2023 · 10 comments

Comments

@bgamari
Copy link
Collaborator

bgamari commented Jun 7, 2023

Currently the default devShell does not include HLS. I recommend that we either enable it by default or introduce another dev-shell (e.g. with-ide or dev) that does so.

@bgamari
Copy link
Collaborator Author

bgamari commented Jun 7, 2023

@MangoIV do you have any opinion on how best to do this?

@MangoIV
Copy link
Contributor

MangoIV commented Jun 7, 2023

it actually does, see this line:

withIde = true;

@MangoIV
Copy link
Contributor

MangoIV commented Jun 7, 2023

how best to do this

the pain here comes from not being able to be able to pass arguments to flake commands, that's why there's this userSettings attrset.

I agree this is not nice, afaik it's worked on on the nix side of things but I can't estimate when that lands.

@MangoIV
Copy link
Contributor

MangoIV commented Jun 7, 2023

fwiw I documented the use of userSettings here:

- To change the settings of the `devShell` to your liking, just adjust the `userSettings` attribute-set in the top-level flake.

Perhaps I should highlight this more prominently?

@MangoIV
Copy link
Contributor

MangoIV commented Jun 7, 2023

I also thought about a flake template so that people can init a custom flake that takes their settings, but I haven't quite had a deep enough look into it.

@MangoIV
Copy link
Contributor

MangoIV commented Jun 7, 2023

another way would be to generate all outputs but that would be quite the hack.

@bgamari
Copy link
Collaborator Author

bgamari commented Jun 7, 2023

fwiw I documented the use of userSettings here:

- To change the settings of the `devShell` to your liking, just adjust the `userSettings` attribute-set in the top-level flake.

Perhaps I should highlight this more prominently?

The problem with userSettings is that it's not uncommon for a user to have more than one GHC tree, each using a different devShell. Modifying the flake makes this workflow very error-prone. I suppose we could recommend that users instead have one ghc.nix checkout per GHC working tree, although this seems non-ideal.

I agree this is not nice, afaik it's worked on on the nix side of things but I can't estimate when that lands.

Even worse, as far as I'm aware, it's not even clear that there is upstream consensus that the status quo is even problematic (or, rather, that there is a solution that wouldn't do more harm than good). For this reason, I do wonder whether we wouldn't be better off offering devShells for common cases, letting the "special" cases be handled by userSettings.

another way would be to generate all outputs but that would be quite the hack.

I agree; generating all outputs seems unnecessary. I think merely handling the common cases (for some value of "common") would be sufficient.

CCing @Ericson2314 as I know he has thought about this and is quite involved on the nix side of things.

@MangoIV
Copy link
Contributor

MangoIV commented Jun 7, 2023

I think merely handling the common cases (for some value of "common") would be sufficient

if John Ericson doesn't know a good solution I can open a corresponding issue as an intermediate solution and also handle that, if you could perhaps tell what's most used in your experience, that would be great.

@bgamari
Copy link
Collaborator Author

bgamari commented Jun 7, 2023

For the record, I believe the relevant upstream issue is NixOS/nix#5663. This comment from Eelco makes me skeptical that an upstream solution is forthcoming.

@MangoIV
Copy link
Contributor

MangoIV commented Jun 9, 2023

@bgamari can you perhaps look whether #172 looks like an intermediate solution for you?

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

2 participants