20 lines
452 B
Nix
20 lines
452 B
Nix
|
{ pkgs, nixpkgs, nixng, globals, ... }: {
|
||
|
mkNixNGImage = name: file:
|
||
|
let
|
||
|
stream = (import file {
|
||
|
inherit nixpkgs nixng globals;
|
||
|
inherit (nixng) nglib;
|
||
|
}).config.system.build.ociImage.stream;
|
||
|
in
|
||
|
pkgs.stdenv.mkDerivation {
|
||
|
name = "${name}.tar";
|
||
|
src = stream;
|
||
|
dontUnpack = true;
|
||
|
buildPhase = ''
|
||
|
$src > $out
|
||
|
'';
|
||
|
};
|
||
|
|
||
|
nixSnapshotterRef = imagePath: "nix:0${imagePath}";
|
||
|
}
|