Hi Mark,

This is usually handled by systemd units. When a service requires a directory, we add ExecBefore scripts to setup the directory. There are plenty such examples in nixos modules. If you need it for you as a user, you could make a service required by multiuser.target.

On the other hand, there are plenty of places where you can insert such commands on the initialization path. For example, you could insert that command in the activate script executed on every boot and every `nixos-rebuild switch`
See the option `system.activationScripts` for details.

I would go for the second option if you need /mnt.

-- layus.

On 10/02/17 01:59, Mark Gardner wrote:
I have searched the manual and options, as well as the Internet, and have not found how to specify in configuration.nix that a directory should exist, in this case /mnt, creating it if not. One might put "if [ ! -d /mnt ] ; then mkdir /mnt; fi" in rc.local. What is the NixOS way to do this (or anything else that one might put in rc.local)?

Mark
--
Mark Gardner
--


_______________________________________________
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev

_______________________________________________
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to