kubernetes-deployments/utils.nix
Pim Kunis 8e09ef5c1e Create helper function to create NixNG images
Move NixNG images to separate directory
2024-10-01 22:51:08 +02:00

19 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}";
}