!SgYlXivkogarTVcnZO:nixos.org

Nix Flakes

887 Members
179 Servers

Load older messages


SenderMessageTime
31 Jan 2024
@bryan.bennett:matrix.orgBryan * 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.bennett:matrix.orgBryanFar 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 can16:30:48
@lxsameer:matrix.orglxsameercan it handle more than one shells?16:30:56
@bryan.bennett:matrix.orgBryanWhat does that mean? 16:31:08
@bryan.bennett:matrix.orgBryan "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:matrix.orglxsameerfor 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.bennett:matrix.orgBryanYes.16:33:59
@bryan.bennett:matrix.orgBryan (Presuming you have two projects with devShell defined) 16:34:15
@bryan.bennett:matrix.orgBryan * (Presuming you have two flakes with devShell defined) 16:34:22
@lxsameer:matrix.orglxsameerno just one flakes file16:34:47
@bryan.bennett:matrix.orgBryanHow do you have two shells defined then?16:35:02
@lxsameer:matrix.orglxsameer

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.bennett:matrix.orgBryandirenv + nix-direnv will not cache these side-by-side, no.16:38:15
@lxsameer:matrix.orglxsameerok then, I have to write something inspired by nix-direnv then16:39:00
@chocolatestrawberry:matrix.org@chocolatestrawberry:matrix.org changed their profile picture.19:02:50
@chocolatestrawberry:matrix.org@chocolatestrawberry:matrix.org changed their profile picture.19:03:29
@chocolatestrawberry:matrix.org@chocolatestrawberry:matrix.org left the room.19:03:49
@netpleb:matrix.orgnetplebi 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:matrix.orgnetpleband 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:matrix.orgnetplebRedacted or Malformed Event23:05:30
1 Feb 2024
@timlepes:humble.hostTim joined the room.03:41:21
@timlepes:humble.hostTim left the room.03:43:38
@timlepes:humble.hostTim joined the room.03:45:00
@buckley310:matrix.orgBuckley
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:matrix.orgnetpleb
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
@mobyturbo:matrix.orgEdLin joined the room.06:21:14
@lxsameer:matrix.orglxsameer 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:matrix.orglxsameeror to be exact, add necessary root paths to prevent the packages required by the flake outputs to be garbage collected.16:53:58
@tanja-6584:matrix.orgTanja (Old; I'm now @tanja:catgirl.cloud) joined the room.17:50:36
3 Feb 2024
@lingo5080:matrix.orglingo5080 joined the room.00:14:23

Show newer messages


Back to Room ListRoom Version: 6