Skip to content

Commit

Permalink
WIP: lxc
Browse files Browse the repository at this point in the history
  • Loading branch information
Lassulus committed Feb 7, 2019
1 parent 0cce792 commit 2fa7a91
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
18 changes: 18 additions & 0 deletions formats/lxc-metadata.nix
Original file line number Diff line number Diff line change
@@ -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: test
'';
target = "/metadata.yaml";
}];
};
formatAttr = "metadata";
}

22 changes: 22 additions & 0 deletions formats/lxc.nix
Original file line number Diff line number Diff line change
@@ -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";
}

0 comments on commit 2fa7a91

Please sign in to comment.