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)
_______________________________________________
nix-dev mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to