| 31 Jan 2024 |
Bryan | * 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 |
Bryan | 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 |
lxsameer | can it handle more than one shells? | 16:30:56 |
Bryan | What does that mean? | 16:31:08 |
Bryan | "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 |
lxsameer | 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 |
Bryan | Yes. | 16:33:59 |
Bryan | (Presuming you have two projects with devShell defined) | 16:34:15 |
Bryan | * (Presuming you have two flakes with devShell defined) | 16:34:22 |
lxsameer | no just one flakes file | 16:34:47 |
Bryan | How do you have two shells defined then? | 16:35:02 |
lxsameer | here is an example:
devShells.default = (pkgs.mkShell.override { stdenv = stdenv';}) {
nativeBuildInputs = buildDevToolsDeps ++ buildToolsDeps ++ shellTools;
buildInputs = buildDeps ++ testDeps;
shellHook =
''
BUILDER= ZDOTDIR=${zshDir} zsh -d && exit
'';
};
# This shell is gcc based and we use it only
# for the mathematics side of our design
devShells.math = nativePkgs.mkShell {
#nativeBuildInputs = mathDeps;
buildInputs = mathDeps;
shellHook =
''
BUILDER=Math ZDOTDIR=${zshDir} zsh -d && exit
'';
};
| 16:36:36 |
Bryan | direnv + nix-direnv will not cache these side-by-side, no. | 16:38:15 |
lxsameer | ok then, I have to write something inspired by nix-direnv then | 16:39:00 |
| @chocolatestrawberry:matrix.org changed their profile picture. | 19:02:50 |
| @chocolatestrawberry:matrix.org changed their profile picture. | 19:03:29 |
| @chocolatestrawberry:matrix.org left the room. | 19:03:49 |
netpleb | i have been trying to setup simple-nixos-mailserver using flakes inside a declarative container. But the solution here https://discourse.nixos.org/t/add-extra-modules-in-declarative-nixos-containers/38107 keeps giving me an "infinite recursion encountered" error. | 21:02:03 |
netpleb | and if I do not get the infinit recursion error, then I get an error "the option containers.mycontainername.mailserver" does not exist. There must be some trick I am missing.
| 21:04:31 |
netpleb | Redacted or Malformed Event | 23:05:30 |
| 1 Feb 2024 |
| Tim joined the room. | 03:41:21 |
| Tim left the room. | 03:43:38 |
| Tim joined the room. | 03:45:00 |
Buckley | In reply to @netpleb:matrix.org and if I do not get the infinit recursion error, then I get an error "the option containers.mycontainername.mailserver" does not exist. There must be some trick I am missing.
hard to say without seeing the config. I do have a working mailserver using that project though, so if you can show how you're setting it up I can compare | 19:43:56 |
| 2 Feb 2024 |
netpleb | In reply to @buckley310:matrix.org hard to say without seeing the config. I do have a working mailserver using that project though, so if you can show how you're setting it up I can compare Thanks for your reply and offer to help. I finally got something mostly working and am trying to clean it up so I can share the config. | 03:57:27 |
| EdLin joined the room. | 06:21:14 |
lxsameer | hey folks, what do you think about the idea of adding a new boolean property to the flake output like addRoot, and when nix will generate or update the lock file, is that property is set to true, then nix will add the directory containing the flake file as a root path to the nix store? | 16:52:51 |
lxsameer | or to be exact, add necessary root paths to prevent the packages required by the flake outputs to be garbage collected. | 16:53:58 |
| Tanja (Old; I'm now @tanja:catgirl.cloud) joined the room. | 17:50:36 |
| 3 Feb 2024 |
| lingo5080 joined the room. | 00:14:23 |