Skip to content

Commit

Permalink
Merge pull request #872 from Atry/patch-5
Browse files Browse the repository at this point in the history
feat: add `containers.<name>.maxLayers` option
  • Loading branch information
domenkozar authored Nov 22, 2023
2 parents 525d60c + 442f963 commit 4ae5d06
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/modules/containers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ let
mkDerivation = cfg: nix2container.nix2container.buildImage {
name = cfg.name;
tag = cfg.version;
maxLayers = cfg.maxLayers;
copyToRoot = [
(pkgs.runCommand "create-paths" { } ''
mkdir -p $out/tmp
Expand Down Expand Up @@ -164,6 +165,13 @@ let
docker run -it ${config.name}:${config.version} "$@"
'';
};

maxLayers = lib.mkOption {
type = types.int;
description = "the maximum number of layers to create.";
defaultText = lib.literalExpression "1";
default = 1;
};
};
});
in
Expand Down

0 comments on commit 4ae5d06

Please sign in to comment.