2024-10-28 15:05:06 +00:00
|
|
|
{
|
2024-12-19 19:34:55 +00:00
|
|
|
self,
|
2024-10-28 15:05:06 +00:00
|
|
|
pkgs,
|
|
|
|
nixpkgs,
|
|
|
|
nixng,
|
|
|
|
globals,
|
2024-12-19 19:34:55 +00:00
|
|
|
nix-snapshotter,
|
2024-10-28 15:05:06 +00:00
|
|
|
...
|
|
|
|
}: {
|
|
|
|
mkNixNGImage = name: file: let
|
|
|
|
stream =
|
|
|
|
(import file {
|
2024-10-01 20:51:08 +00:00
|
|
|
inherit nixpkgs nixng globals;
|
|
|
|
inherit (nixng) nglib;
|
2024-10-28 15:05:06 +00:00
|
|
|
})
|
|
|
|
.config
|
|
|
|
.system
|
|
|
|
.build
|
|
|
|
.ociImage
|
|
|
|
.stream;
|
|
|
|
in
|
2024-10-01 20:51:08 +00:00
|
|
|
pkgs.stdenv.mkDerivation {
|
|
|
|
name = "${name}.tar";
|
|
|
|
src = stream;
|
|
|
|
dontUnpack = true;
|
|
|
|
buildPhase = ''
|
|
|
|
$src > $out
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
nixSnapshotterRef = imagePath: "nix:0${imagePath}";
|
2024-12-19 19:34:55 +00:00
|
|
|
|
|
|
|
mkNixNGImage2 = name:
|
|
|
|
(nix-snapshotter.packages.${pkgs.stdenv.system}.nix-snapshotter.buildImage {
|
|
|
|
inherit name;
|
|
|
|
resolvedByNix = true;
|
|
|
|
config.entrypoint = ["${self.nixngConfigurations.${pkgs.stdenv.system}.${name}.config.system.build.toplevel}/init"];
|
|
|
|
})
|
|
|
|
.image;
|
2024-10-01 20:51:08 +00:00
|
|
|
}
|