[Nix-dev] Custom directories

Daniel Hlynskyi abcz2.uprola at gmail.com
Wed May 25 16:26:24 CEST 2016


Hi. What's canonical Nixos way to specify custom directories?

I'm playing with containers. Here is excerpt of my config:

  fileSystems."/media/logs" = { fsType = "ext4";  label = "logs"; };
  boot.initrd.postMountCommands = ''
    chmod 777 /media/logs
  '';

  containers.dwarfs =
    { bindMounts."/media/logs/dwarfs".hostPath = "/media/logs/dwarfs";
      bindMounts."/media/logs/dwarfs".isReadOnly = false;
      config =
   { config, pkgs, ... }:
   {
         boot.postBootCommands = ''
                chmod 777 /media/logs/dwarfs
             '';

I'd like for directory /media/logs/dwarfs to exist, but I don't know where
to put _the_ mkdir.

boot.initrd.postMountCommands is not exactly what I want, because I need to
remount drive or reboot host for changes to apply, but plain nixos-rebuild
switch doesn't execute postMountCommands.

Also I'd like to change directory mask in containers without container
restart (instead of boot.postBootCommands)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20160525/ae6a605d/attachment.html 


More information about the nix-dev mailing list