mirror of
https://github.com/0xbbjubjub/miniguest.git
synced 2024-12-13 08:12:17 +03:00
17 lines
508 B
Nix
17 lines
508 B
Nix
{ 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
|
|
''
|