This commit is contained in:
Bryton Hall 2022-08-31 21:38:14 -04:00
parent ee38caab0e
commit 7ba59d844f
4 changed files with 24 additions and 14 deletions

View file

@ -1,4 +1,4 @@
{ {
deployment = import ./deployment { }; deployment = import ./deployment {};
testing = import ./testing { }; testing = import ./testing {};
} }

View file

@ -1,10 +1,15 @@
{ kubenix ? import ../../../.. }: {kubenix ? import ../../../..}:
kubenix.evalModules.${builtins.currentSystem} { kubenix.evalModules.${builtins.currentSystem} {
module = {kubenix, config, pkgs, ...}: { module = {
kubenix,
config,
pkgs,
...
}: {
imports = with kubenix.modules; [k8s docker]; imports = with kubenix.modules; [k8s docker];
docker = { docker = {
registry.url = "docker.somewhere.io"; registry.url = "docker.somewhere.io";
images.example.image = pkgs.callPackage ./image.nix {}; images.example.image = pkgs.callPackage ./image.nix {};
}; };
kubernetes.resources.pods.example.spec.containers = { kubernetes.resources.pods.example.spec.containers = {
custom.image = config.docker.images.example.path; custom.image = config.docker.images.example.path;

View file

@ -147,12 +147,11 @@
inherit pkgs; inherit pkgs;
options = options =
(self.evalModules.${system} { (self.evalModules.${system} {
modules = modules = builtins.attrValues (builtins.removeAttrs
builtins.attrValues (builtins.removeAttrs # the submodules module currently doesn't evaluate:
# the submodules module currently doesn't evaluate: # error: No module found name/latest
# error: No module found name/latest # not sure how important that documentation is a this time
# not sure how important that documentation is a this time self.nixosModules.kubenix ["submodule" "submodules"]);
self.nixosModules.kubenix ["submodule" "submodules"]);
}) })
.options; .options;
}; };

View file

@ -34,13 +34,19 @@ in {
name = mkOption { name = mkOption {
description = "Desired docker image name"; description = "Desired docker image name";
type = types.str; type = types.str;
default = if config.image != null then builtins.unsafeDiscardStringContext config.image.imageName else ""; default =
if config.image != null
then builtins.unsafeDiscardStringContext config.image.imageName
else "";
}; };
tag = mkOption { tag = mkOption {
description = "Desired docker image tag"; description = "Desired docker image tag";
type = types.str; type = types.str;
default = if config.image != null then builtins.unsafeDiscardStringContext config.image.imageTag else ""; default =
if config.image != null
then builtins.unsafeDiscardStringContext config.image.imageTag
else "";
}; };
registry = mkOption { registry = mkOption {