mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-12 16:10:05 +01:00
feat: initial docker image module
This commit is contained in:
parent
aab68623e0
commit
03e1f4c1c4
2 changed files with 52 additions and 0 deletions
|
|
@ -5,4 +5,5 @@
|
||||||
istio = ./istio;
|
istio = ./istio;
|
||||||
testing = ./testing;
|
testing = ./testing;
|
||||||
helm = ./helm;
|
helm = ./helm;
|
||||||
|
docker = ./docker;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
51
modules/docker/default.nix
Normal file
51
modules/docker/default.nix
Normal file
|
|
@ -0,0 +1,51 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
{
|
||||||
|
options.docker.registry.url = mkOption {
|
||||||
|
description = "Default registry url where images are published";
|
||||||
|
type = types.str;
|
||||||
|
};
|
||||||
|
|
||||||
|
options.docker.images = mkOption {
|
||||||
|
description = "Attribute set of docker images that should be published";
|
||||||
|
type = types.attrsOf (types.submodule ({ name, config, ... }: {
|
||||||
|
options = {
|
||||||
|
image = mkOption {
|
||||||
|
description = "Docker image to publish";
|
||||||
|
type = types.nullOr types.package;
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
name = mkOption {
|
||||||
|
description = "Desired docker image name";
|
||||||
|
type = types.str;
|
||||||
|
default = builtins.unsafeDiscardStringContext config.image.imageName;
|
||||||
|
};
|
||||||
|
|
||||||
|
tag = mkOption {
|
||||||
|
description = "Desired docker image tag";
|
||||||
|
type = types.str;
|
||||||
|
default = builtins.unsafeDiscardStringContext config.image.imageTag;
|
||||||
|
};
|
||||||
|
|
||||||
|
registry = mkOption {
|
||||||
|
description = "Docker registry url where image is published";
|
||||||
|
type = types.str;
|
||||||
|
default = config.docker.registry.url;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}));
|
||||||
|
default = {};
|
||||||
|
};
|
||||||
|
|
||||||
|
options.docker.push = mkOption {
|
||||||
|
description = "List of images to push";
|
||||||
|
type = types.listOf (types.package);
|
||||||
|
default = [];
|
||||||
|
};
|
||||||
|
|
||||||
|
config.docker.push = mapAttrsToList (_: i: i.image)
|
||||||
|
(filterAttrs (_: i: i.registry != null)config.docker.images);
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue