miniguest/tool/lxc-template.nix

17 lines
508 B
Nix
Raw Permalink Normal View History

2021-08-02 22:41:12 +03:00
{ runCommand, fakeroot }:
runCommand "miniguest-lxc-template" { nativeBuildInputs = [ fakeroot ]; } ''
cat >config << EOF
lxc.include = LXC_TEMPLATE_CONFIG/common.conf
lxc.mount.entry = /nix/store nix/store none ro,bind,create=dir 0 0
lxc.mount.entry = /etc/miniguests/LXC_NAME/boot boot none ro,bind,create=dir 0 0
lxc.init.cmd = /boot/init
EOF
mkdir -p rootfs/{nix/store,boot}
mkdir -p $out
fakeroot tar cJf $out/rootfs.tar.xz -C rootfs .
fakeroot tar cJf $out/meta.tar.xz config
''