[prev in list] [next in list] [prev in thread] [next in thread] 

List:       nix-dev
Subject:    [Nix-dev] Custom directories
From:       Daniel Hlynskyi <abcz2.uprola () gmail ! com>
Date:       2016-05-25 14:26:24
Message-ID: CANZg+ydxXfAhzyVu8UjwRuVhNOp7mZ2nPAonzrxP3SdgoAb1fQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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)

[Attachment #5 (text/html)]

<div dir="ltr">Hi. What&#39;s canonical Nixos way to specify custom \
directories?<br><br>I&#39;m playing with containers. Here is excerpt of my \
config:<br><br><div>   fileSystems.&quot;/media/logs&quot; = { fsType = \
&quot;ext4&quot;;   label = &quot;logs&quot;; };</div><div>   \
boot.initrd.postMountCommands = &#39;&#39;<br></div><div>      chmod 777 \
/media/logs</div><div>   &#39;&#39;;<br></div><div><br></div><div>   \
containers.dwarfs =</div><div>      { \
bindMounts.&quot;/media/logs/dwarfs&quot;.hostPath = \
&quot;/media/logs/dwarfs&quot;;</div><div>         \
bindMounts.&quot;/media/logs/dwarfs&quot;.isReadOnly = false;</div><div>          \
config =  </div><div><span style="white-space:pre">         </span>   { config, pkgs, \
... }:</div><div><span style="white-space:pre">         </span>   {</div><div><span \
style="white-space:pre">      </span>            boot.postBootCommands = \
&#39;&#39;<br></div><div>                        chmod 777 \
/media/logs/dwarfs</div><div>                    &#39;&#39;;</div><div><br>I&#39;d \
like for directory /media/logs/dwarfs to exist, but I don&#39;t know where to put \
_the_ mkdir.  </div><div><br></div><div>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&#39;t execute postMountCommands.<br><br>Also I&#39;d \
like to change directory mask in containers without container restart (instead of \
boot.postBootCommands)</div></div>



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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic