diff options
author | pennae <github@quasiparticle.net> | 2021-12-05 20:40:24 +0100 |
---|---|---|
committer | pennae <github@quasiparticle.net> | 2021-12-09 01:12:13 +0100 |
commit | e24a8775a86905ad001c4c965a7d180b41c10c52 (patch) | |
tree | 62da74c469bec798898d88029919f2bbd9f01442 /nixos/modules/security/dhparams.nix | |
parent | 70b105d1d062369c7489b0045df5a8b86bac5dd6 (diff) |
treewide: set defaultText for options using simple path defaults
adds defaultText for all options that set their default to a path expression using the ubiquitous `cfg` shortcut bindings.
Diffstat (limited to 'nixos/modules/security/dhparams.nix')
-rw-r--r-- | nixos/modules/security/dhparams.nix | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/nixos/modules/security/dhparams.nix b/nixos/modules/security/dhparams.nix index 012be2887d898..cfa9003f12fb6 100644 --- a/nixos/modules/security/dhparams.nix +++ b/nixos/modules/security/dhparams.nix @@ -1,8 +1,9 @@ -{ config, lib, pkgs, ... }: +{ config, lib, options, pkgs, ... }: let - inherit (lib) mkOption types; + inherit (lib) literalExpression mkOption types; cfg = config.security.dhparams; + opt = options.security.dhparams; bitType = types.addCheck types.int (b: b >= 16) // { name = "bits"; @@ -13,6 +14,7 @@ let options.bits = mkOption { type = bitType; default = cfg.defaultBitSize; + defaultText = literalExpression "config.${opt.defaultBitSize}"; description = '' The bit size for the prime that is used during a Diffie-Hellman key exchange. |