[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's canonical Nixos way to specify custom \
directories?<br><br>I'm playing with containers. Here is excerpt of my \
config:<br><br><div> fileSystems."/media/logs" = { fsType = \
"ext4"; label = "logs"; };</div><div> \
boot.initrd.postMountCommands = ''<br></div><div> chmod 777 \
/media/logs</div><div> '';<br></div><div><br></div><div> \
containers.dwarfs =</div><div> { \
bindMounts."/media/logs/dwarfs".hostPath = \
"/media/logs/dwarfs";</div><div> \
bindMounts."/media/logs/dwarfs".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 = \
''<br></div><div> chmod 777 \
/media/logs/dwarfs</div><div> '';</div><div><br>I'd \
like for directory /media/logs/dwarfs to exist, but I don'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't execute postMountCommands.<br><br>Also I'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