Known mutable location in filesystem for lock files

I’m packaging a C++ package manager for nix. The package manager only supports one executable to do stuff at a time, so the package manager creates a lockfile in the filesystem, like pacman or dpkg.

I was wondering: is there a known mutable directory where programs can create such lock file? Normally I would assume /var but is this okay in the nix world?

Thanks for the help!

Even NixOS has /var/run, so I would suggest that his is indeed the correct location.

Thank you very much!

Even NixOS has /var/run, so I would suggest that his is indeed the correct location.

/var/run has been deprecated in favour of /run (the former is a symlink to the latter).

1 Like