diff options
author | Graham Christensen <graham@grahamc.com> | 2021-12-17 11:14:08 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-17 11:14:08 -0500 |
commit | 06edb74413eb4e4ac56921ef2c038d8f106b15df (patch) | |
tree | 897b78ed67fd8ffb0938fc85f52a496ff9785e7c /nixos/modules/services/misc/etcd.nix | |
parent | 4edd5c91ca09665e33f705d280a4d9f7f093605f (diff) | |
parent | e67a646a925bc3cda86101a3f3afb81db3030ef5 (diff) | |
download | nixpkgs-06edb74413eb4e4ac56921ef2c038d8f106b15df.tar nixpkgs-06edb74413eb4e4ac56921ef2c038d8f106b15df.tar.gz nixpkgs-06edb74413eb4e4ac56921ef2c038d8f106b15df.tar.bz2 nixpkgs-06edb74413eb4e4ac56921ef2c038d8f106b15df.tar.lz nixpkgs-06edb74413eb4e4ac56921ef2c038d8f106b15df.tar.xz nixpkgs-06edb74413eb4e4ac56921ef2c038d8f106b15df.tar.zst nixpkgs-06edb74413eb4e4ac56921ef2c038d8f106b15df.zip |
Merge pull request #148785 from pennae/more-option-doc-staticizing
treewide: more defaultText for options
Diffstat (limited to 'nixos/modules/services/misc/etcd.nix')
-rw-r--r-- | nixos/modules/services/misc/etcd.nix | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/nixos/modules/services/misc/etcd.nix b/nixos/modules/services/misc/etcd.nix index 26ad1ad5536..3925b7dd163 100644 --- a/nixos/modules/services/misc/etcd.nix +++ b/nixos/modules/services/misc/etcd.nix @@ -1,9 +1,10 @@ -{ config, lib, pkgs, ... }: +{ config, lib, options, pkgs, ... }: with lib; let cfg = config.services.etcd; + opt = options.services.etcd; in { @@ -24,6 +25,7 @@ in { advertiseClientUrls = mkOption { description = "Etcd list of this member's client URLs to advertise to the rest of the cluster."; default = cfg.listenClientUrls; + defaultText = literalExpression "config.${opt.listenClientUrls}"; type = types.listOf types.str; }; @@ -42,12 +44,14 @@ in { initialAdvertisePeerUrls = mkOption { description = "Etcd list of this member's peer URLs to advertise to rest of the cluster."; default = cfg.listenPeerUrls; + defaultText = literalExpression "config.${opt.listenPeerUrls}"; type = types.listOf types.str; }; initialCluster = mkOption { description = "Etcd initial cluster configuration for bootstrapping."; default = ["${cfg.name}=http://127.0.0.1:2380"]; + defaultText = literalExpression ''["''${config.${opt.name}}=http://127.0.0.1:2380"]''; type = types.listOf types.str; }; @@ -96,18 +100,21 @@ in { peerCertFile = mkOption { description = "Cert file to use for peer to peer communication"; default = cfg.certFile; + defaultText = literalExpression "config.${opt.certFile}"; type = types.nullOr types.path; }; peerKeyFile = mkOption { description = "Key file to use for peer to peer communication"; default = cfg.keyFile; + defaultText = literalExpression "config.${opt.keyFile}"; type = types.nullOr types.path; }; peerTrustedCaFile = mkOption { description = "Certificate authority file to use for peer to peer communication"; default = cfg.trustedCaFile; + defaultText = literalExpression "config.${opt.trustedCaFile}"; type = types.nullOr types.path; }; |