summary refs log tree commit diff
path: root/nixos/modules/services/cluster/kubernetes/apiserver.nix
diff options
context:
space:
mode:
authorpennae <github@quasiparticle.net>2021-12-05 20:48:56 +0100
committerpennae <github@quasiparticle.net>2021-12-09 01:13:12 +0100
commitf6d0b014fe1db9e6edec5485f41a1162136c8a70 (patch)
tree63a1b5dde36ce216a9cc8e32975cb50e1ac9da68 /nixos/modules/services/cluster/kubernetes/apiserver.nix
parente24a8775a86905ad001c4c965a7d180b41c10c52 (diff)
downloadnixpkgs-f6d0b014fe1db9e6edec5485f41a1162136c8a70.tar
nixpkgs-f6d0b014fe1db9e6edec5485f41a1162136c8a70.tar.gz
nixpkgs-f6d0b014fe1db9e6edec5485f41a1162136c8a70.tar.bz2
nixpkgs-f6d0b014fe1db9e6edec5485f41a1162136c8a70.tar.lz
nixpkgs-f6d0b014fe1db9e6edec5485f41a1162136c8a70.tar.xz
nixpkgs-f6d0b014fe1db9e6edec5485f41a1162136c8a70.tar.zst
nixpkgs-f6d0b014fe1db9e6edec5485f41a1162136c8a70.zip
nixos/kubernetes: add defaultText for addons options using top.*
the kubernetes modules cross-reference their config using an additional shortcut
binding `top = config.services.kubernetes`, expand those to defaultText like
`cfg` previously.
Diffstat (limited to 'nixos/modules/services/cluster/kubernetes/apiserver.nix')
-rw-r--r--nixos/modules/services/cluster/kubernetes/apiserver.nix7
1 files changed, 6 insertions, 1 deletions
diff --git a/nixos/modules/services/cluster/kubernetes/apiserver.nix b/nixos/modules/services/cluster/kubernetes/apiserver.nix
index 2c89310beb5..5b97c571d76 100644
--- a/nixos/modules/services/cluster/kubernetes/apiserver.nix
+++ b/nixos/modules/services/cluster/kubernetes/apiserver.nix
@@ -1,9 +1,10 @@
-  { config, lib, pkgs, ... }:
+  { config, lib, options, pkgs, ... }:
 
 with lib;
 
 let
   top = config.services.kubernetes;
+  otop = options.services.kubernetes;
   cfg = top.apiserver;
 
   isRBACEnabled = elem "RBAC" cfg.authorizationMode;
@@ -84,6 +85,7 @@ in
     clientCaFile = mkOption {
       description = "Kubernetes apiserver CA file for client auth.";
       default = top.caFile;
+      defaultText = literalExpression "config.${otop.caFile}";
       type = nullOr path;
     };
 
@@ -138,6 +140,7 @@ in
       caFile = mkOption {
         description = "Etcd ca file.";
         default = top.caFile;
+        defaultText = literalExpression "config.${otop.caFile}";
         type = types.nullOr types.path;
       };
     };
@@ -157,6 +160,7 @@ in
     featureGates = mkOption {
       description = "List set of feature gates";
       default = top.featureGates;
+      defaultText = literalExpression "config.${otop.featureGates}";
       type = listOf str;
     };
 
@@ -175,6 +179,7 @@ in
     kubeletClientCaFile = mkOption {
       description = "Path to a cert file for connecting to kubelet.";
       default = top.caFile;
+      defaultText = literalExpression "config.${otop.caFile}";
       type = nullOr path;
     };