New to NixOS and have a question on Nix Shell - eviltoast

I just switched one of my systems over to NixOS from Arch and so far it seems interesting. One question I had is regarding the nix-shell. So I get the basic concept of it and that it allows creating a shell that has packages installed with that shell making ideal for dev environments. I’ve even seen talks where the suggest nix-shells over docker/podman, my question is how is persistent data (like databases) handled?

  • vendion@lemmy.mlOP
    link
    fedilink
    English
    arrow-up
    2
    ·
    9 months ago

    Okay, that’s good to know. I just wanted to make sure that if I had something like MariaDB or Postgres get installed with nix-shell that I wouldn’t lose everything thus having to set everything back up next time I start the shell again.

    • kevincox@lemmy.ml
      link
      fedilink
      English
      arrow-up
      3
      ·
      9 months ago

      No, you won’t lose anything. However do be aware that unless you specifically configure different data directories using the same DBMS in multiple projects will use the same underlying data files.

      Typically this won’t be a problem, and you can just create different logical databases if necessary.