Nix Flakes | 904 Members | |
| 184 Servers |
| Sender | Message | Time |
|---|---|---|
| 28 Jan 2024 | ||
| Would it be possible to make a root in the flake itself via nix? | 23:00:31 | |
| 29 Jan 2024 | ||
| 10:58:52 | ||
| 11:06:03 | ||
In reply to @lxsameer:matrix.orgJust look how direnv does that. | 12:07:30 | |
| cheers | 12:07:45 | |
| is there any docs on the structure of the store that I can use while I'm working on this? | 18:14:33 | |
| 30 Jan 2024 | ||
| 19:55:30 | ||
| 31 Jan 2024 | ||
| 03:36:26 | ||
| 06:22:05 | ||
| lxsameer: This is exactly what nix-direnv does, for the record. We create the root in the direnv layout dir (which is kind of what that directory is for - creating state that we need for direnv-related things) | 15:34:40 | |
In reply to @bryan.bennett:matrix.orgwhat do you mean by "We create the root in the direnv layout dir"? | 16:20:03 | |
| There are multiple things that might require explaining there, so I'll talk about them individually:
| 16:25:44 | |
| lxsameer: ^ | 16:25:50 | |
| thank you, I had a look at nix-direnv and direnv the other day, I'll try to write somthing and try it out | 16:27:29 | |
| but it would be cool to have a reference for how the store works | 16:27:46 | |
| I think what I am trying to say is that you don't need to write anything. | 16:27:55 | |
| lxsameer: If you're looking for something that prevents your devShell installed software from getting garbage-collected, nix-direnv just does it already | 16:29:06 | |
* lxsameer: If you're looking for something that prevents your devShell installed software from getting garbage-collected, nix-direnv just does it already (it should be noted that - by default - the layout dir is <project_directory>/.direnv, which is "inside the flake") | 16:29:57 | |
| Far be it from me to say "don't write a competitor" (I am one of the maintainers for nix-direnv and I wrote one...), but if you just want to skip to the solution - you can | 16:30:48 | |
| can it handle more than one shells? | 16:30:56 | |
| What does that mean? | 16:31:08 | |
"Can you do this pattern for an arbitrary number of shells"? Yes - of course. When you cd into the project directory, you'll activate the appropriate one (and you'll hit the cache if you've activated this before, assuming you have direnv and nix-direnv set up properly) | 16:32:14 | |
| for example, I have a clang based shell and a gcc based shell, would it be able to cache both and prevent all the packages to be excluded from gc? | 16:33:29 | |
| Yes. | 16:33:59 | |
(Presuming you have two projects with devShell defined) | 16:34:15 | |
* (Presuming you have two flakes with devShell defined) | 16:34:22 | |
| no just one flakes file | 16:34:47 | |
| How do you have two shells defined then? | 16:35:02 | |
| here is an example:
| 16:36:36 | |
| direnv + nix-direnv will not cache these side-by-side, no. | 16:38:15 | |