--===============0764223859== Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/yD3vTYzCdzClvNi8ut/Gfgf"; protocol="application/pgp-signature" --Sig_/yD3vTYzCdzClvNi8ut/Gfgf Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, 25 May 2016 17:26:24 +0300 Daniel Hlynskyi wrote: > Hi. What's canonical Nixos way to specify custom directories? >=20 > I'm playing with containers. Here is excerpt of my config: >=20 > fileSystems."/media/logs" =3D { fsType =3D "ext4"; label =3D "logs"; }; > boot.initrd.postMountCommands =3D '' > chmod 777 /media/logs > ''; >=20 > containers.dwarfs =3D > { bindMounts."/media/logs/dwarfs".hostPath =3D "/media/logs/dwarfs"; > bindMounts."/media/logs/dwarfs".isReadOnly =3D false; > config =3D > { config, pkgs, ... }: > { > boot.postBootCommands =3D '' > chmod 777 /media/logs/dwarfs > ''; >=20 > I'd like for directory /media/logs/dwarfs to exist, but I don't know > where to put _the_ mkdir. >=20 > 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. >=20 > Also I'd like to change directory mask in containers without container > restart (instead of boot.postBootCommands) Here is how one of my containers has its data dir in a special partition with special permissions: https://github.com/kampfschlaefer/nixconfig/blob/master/portal/containers/m= pd.nix Note that the directory is created by systemd before mounting partition. But maybe the bindMounts of containers need to be extended so they also create the target directory with the permissions you want. But what happens when you want a userid for permissions that exists only inside the container? Current bindmount stuff is outside the container=E2=80=A6 - Arnold --Sig_/yD3vTYzCdzClvNi8ut/Gfgf Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iF4EAREIAAYFAldGB8UACgkQtuvagsE+DE52GwEA9cTcwcHWizpLwfZCnKjvV/mL MLPtAnvlmLzSSisRfq4A/2ytFjgeowcYuSQyAxWebMFZv3w6UPpu1paIzFWe/DQt =aoZi -----END PGP SIGNATURE----- --Sig_/yD3vTYzCdzClvNi8ut/Gfgf-- --===============0764223859== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev --===============0764223859==--