kubernetes-deployments/utils.nix
2024-10-28 16:05:06 +01:00

30 lines
495 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}";
}