[Nix-dev] How to ensure that a directory exists via configuration.nix

David Izquierdo thecofee at gmail.com
Fri Feb 10 17:11:26 CET 2017


Is there any reason not to use `mkdir -p`, to spare yourself the if?


On 10/02/17 17:06, Mark Gardner wrote:
> Once again, thanks Layus!
>
> For the benefit of others, here is what I put in my configuration.nix:
>
>    system.activationScripts = {
>        mnt = {
>          text = ''if [ ! -d /mnt ] ; then mkdir /mnt; fi";
>          deps = [];
>        };
>     };
>
> Mark
>
>
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev



More information about the nix-dev mailing list