mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-12 16:10:05 +01:00
feat(modules): set default namespace from parent module namespace
This commit is contained in:
parent
db196666d4
commit
df2f00a729
2 changed files with 7 additions and 2 deletions
|
|
@ -18,6 +18,7 @@ let
|
|||
inherit pkgs;
|
||||
inherit (pkgs) lib;
|
||||
};
|
||||
module = null;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
{ config, lib, pkgs, k8s, ... }:
|
||||
{ config, lib, pkgs, k8s, module ? null, ... }:
|
||||
|
||||
with lib;
|
||||
with import ./lib.nix { inherit pkgs lib; };
|
||||
|
||||
let
|
||||
globalConfig = config;
|
||||
parentModule = module;
|
||||
|
||||
# A submodule (like typed attribute set). See NixOS manual.
|
||||
submodule = opts:
|
||||
|
|
@ -138,7 +139,10 @@ in {
|
|||
namespace = mkOption {
|
||||
description = "Namespace where to deploy module";
|
||||
type = types.str;
|
||||
default = "default";
|
||||
default =
|
||||
if parentModule != null
|
||||
then parentModule.namespace
|
||||
else "default";
|
||||
};
|
||||
|
||||
labels = mkOption {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue