mirror of
https://github.com/nix-community/nixos-generators.git
synced 2024-11-22 18:24:59 +03:00
commit
defb4eed14
@ -36,6 +36,8 @@ install-iso | Installer ISO
|
||||
iso | ISO
|
||||
kexec | kexec tarball (extract to / and run /kexec_nixos)
|
||||
kexec-bundle | same as before, but it's just an executable
|
||||
lxc | create a tarball which is importable as an lxc container, use together with lxc-metadata
|
||||
lxc-metadata | the necessary metadata for the lxc image to start, usage: lxc image import $(nixos-generate -f lxc-metadata) $(nixos-generate -f lxc)
|
||||
openstack | qcow2 image for openstack
|
||||
cloudstack | qcow2 image for cloudstack
|
||||
qcow2 | qcow2 image
|
||||
|
18
formats/lxc-metadata.nix
Normal file
18
formats/lxc-metadata.nix
Normal file
@ -0,0 +1,18 @@
|
||||
{ config, pkgs, modulesPath, ... }:
|
||||
{
|
||||
system.build.metadata = pkgs.callPackage <nixpkgs/nixos/lib/make-system-tarball.nix> {
|
||||
contents = [{
|
||||
source = pkgs.writeText "metadata.yaml" ''
|
||||
architecture: x86_64
|
||||
creation_date: 1424284563
|
||||
properties:
|
||||
description: NixOS
|
||||
os: NixOS
|
||||
release: ${config.system.stateVersion}
|
||||
'';
|
||||
target = "/metadata.yaml";
|
||||
}];
|
||||
};
|
||||
formatAttr = "metadata";
|
||||
}
|
||||
|
22
formats/lxc.nix
Normal file
22
formats/lxc.nix
Normal file
@ -0,0 +1,22 @@
|
||||
{ config, pkgs, lib, modulesPath, ... }: let
|
||||
pkgs2storeContents = l : map (x: { object = x; symlink = "none"; }) l;
|
||||
in {
|
||||
imports = [
|
||||
"${toString modulesPath}/virtualisation/lxc-container.nix"
|
||||
];
|
||||
|
||||
system.build.tarball = lib.mkForce (pkgs.callPackage <nixpkgs/nixos/lib/make-system-tarball.nix> {
|
||||
contents = [];
|
||||
extraArgs = "--owner=0";
|
||||
storeContents = [
|
||||
{
|
||||
object = config.system.build.toplevel + "/init";
|
||||
symlink = "/sbin/init";
|
||||
}
|
||||
] ++ (pkgs2storeContents [ pkgs.stdenv ]);
|
||||
|
||||
extraCommands = "mkdir -p proc sys dev";
|
||||
});
|
||||
|
||||
formatAttr = "tarball";
|
||||
}
|
Loading…
Reference in New Issue
Block a user