[Nix-dev] Variable data files

Matthew Sackman matthew at wellquite.org
Thu Apr 3 17:57:40 CEST 2014


On Thu, Apr 03, 2014 at 10:52:09AM -0500, Colin Putney wrote:
> 1) Is there a standard place for application installed in the nix store to
> use for variable data?

If it's run by the system (eg started by systemd) then it should
probably be somewhere under /var (often /var/lib, but I've never
understood why).

If it's run by the user then somewhere under ~/. Eg the rabbitmq package
uses ~/.rabbitmq/$version/

> 2) Is there a standard place for application logs?

Same logic applies, with /var/log in particular for system daemons.

> 3) I'm going to be deploying with nixops. What's the best way to handle
> creating these directories setting ownership and permissions etc.

If it's started by systemd then I'd personally suggest preStart.
Otherwise, whatever the script is the user runs to start it (i.e. you
may need to create a wrapper of sorts).

Matthew


More information about the nix-dev mailing list