mirror of
https://github.com/0xbbjubjub/miniguest.git
synced 2025-01-08 13:38:13 +03:00
Add LXC image
This commit is contained in:
parent
c5bd000c4f
commit
993e12d53d
16
miniguest/lxc-template.nix
Normal file
16
miniguest/lxc-template.nix
Normal 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
|
||||
''
|
@ -1,3 +1,4 @@
|
||||
final: prev: {
|
||||
miniguest-lxc-template = final.callPackage ./lxc-template.nix { };
|
||||
miniguest = final.callPackage ./package.nix { };
|
||||
}
|
||||
|
@ -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 ];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user