Create helper function to create NixNG images
Move NixNG images to separate directory
This commit is contained in:
parent
e3ff293c0c
commit
8e09ef5c1e
6 changed files with 31 additions and 39 deletions
19
utils.nix
Normal file
19
utils.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{ 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}";
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue