Add LXC image

This commit is contained in:
Julie B. 2021-08-02 21:41:12 +02:00
parent c5bd000c4f
commit 993e12d53d
3 changed files with 19 additions and 2 deletions

View File

@ -0,0 +1,16 @@
{ 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
''

View File

@ -1,3 +1,4 @@
final: prev: {
miniguest-lxc-template = final.callPackage ./lxc-template.nix { };
miniguest = final.callPackage ./package.nix { };
}

View File

@ -12,12 +12,12 @@
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
{ lib, stdenvNoCC, argbash, bash, coreutils, nixFlakes, shellcheck, makeWrapper }:
{ lib, stdenvNoCC, argbash, bash, coreutils, miniguest-lxc-template, nixFlakes, shellcheck, makeWrapper }:
stdenvNoCC.mkDerivation {
name = "miniguest";
src = ./.;
inherit bash nixFlakes;
inherit bash miniguest-lxc-template nixFlakes;
nativeBuildInputs = [ argbash makeWrapper ];