this post was submitted on 26 Feb 2024
20 points (100.0% liked)
Nix / NixOS
1753 readers
16 users here now
Main links
Videos
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
In general Nix doesn't manage persistent data. It will be stored in whatever location the tool writes it to.
nix-shell
is a very simple program. Basically it downloads/builds the package you have configured, then sets up environment variables likePATH
to include that package. It would be similar to downloading a pre-built tarball run running./foo
inside of that.For most built-in modules this will be
/var/lib/foo
for a servicefoo
. If you runnix-shell
the service will write data wherever it would normally write data on any other distribution.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.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.