{ nixpkgs ? }: with import ; let pkgs = import nixpkgs {}; stdenv = pkgs.stdenv; pkgs2storeContents = l : map (x: { object = x; symlink = "none"; }) l; makeSystemTarball = { module, system }: let versionModule = { system.nixosVersionSuffix = "orbekk"; system.nixosRevision = "master"; }; config = (import { inherit system; modules = [ module versionModule ]; }).config; tarball = import { inherit (pkgs) stdenv perl xz pathsFromGraph; contents = []; extraArgs = "--owner=0"; # Add init script to image storeContents = [ { object = config.system.build.toplevel + "/init"; symlink = "/init"; } ] ++ (pkgs2storeContents [ stdenv ]); # Some container managers like lxc need these extraCommands = pkgs.writeScript "setup.sh" '' mkdir -p proc sys dev sbin ln -s ${config.system.build.toplevel}/init sbin/init ''; }; in tarball // { inherit config; }; in { containerTarball = (import {}) .containerTarball.x86_64-linux; kjContainerTarball = makeSystemTarball { module = ./machines/generic-container.nix; system = "x86_64-linux"; }; tests = { common = import tests/common.nix; desktop = import tests/desktop.nix; container-shape = import tests/container-shape.nix; # gitlab = import tests/gitlab.nix; }; }