Hello all!
I’ve been toiling away trying to adapt make-btrfs-fs.nix
(kindly provided by @c00w – thank you!) to create subvolumes (instead of populating everything into the root subvolume).
Unfortunately, AFAICT one cannot create a BTRFS subvolume directly on an image; it must be mounted, and then can be created via btrfs subvol create /path/to/mount/subvolname
.
Also unfortunately, it doesn’t seem that I’m able to mount anything in a script due to absence of root privileges, and fakeroot
doesn’t seem to work around the issue:
++ mkdir ./btrfsmount
++ fakeroot ${pkgs.mount}/bin/mount $img ./btrfsmount
mount: ./btrfsmount: mount failed: Operation not permitted
Is there another way to go about creating btrfs subvolumes within a derivation?
Please forgive mistakes in terminology; made it through Nix Pills this week and obviously still have a lot to learn.
TIA for any help!