mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 13:40:28 +03:00
treewide: add defaultText for options with simple interpolation defaults
adds defaultText for all options that use `cfg.*` values in their defaults, but only for interpolations with no extra processing (other than toString where necessary)
This commit is contained in:
parent
f6d0b014fe
commit
fb0e5be843
31 changed files with 136 additions and 29 deletions
|
@ -1,9 +1,10 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, options, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.graphite;
|
||||
opt = options.services.graphite;
|
||||
writeTextOrNull = f: t: mapNullable (pkgs.writeTextDir f) t;
|
||||
|
||||
dataDir = cfg.dataDir;
|
||||
|
@ -312,12 +313,14 @@ in {
|
|||
|
||||
seyrenUrl = mkOption {
|
||||
default = "http://localhost:${toString cfg.seyren.port}/";
|
||||
defaultText = literalExpression ''"http://localhost:''${toString config.${opt.seyren.port}}/"'';
|
||||
description = "Host where seyren is accessible.";
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
graphiteUrl = mkOption {
|
||||
default = "http://${cfg.web.listenAddress}:${toString cfg.web.port}";
|
||||
defaultText = literalExpression ''"http://''${config.${opt.web.listenAddress}}:''${toString config.${opt.web.port}}"'';
|
||||
description = "Host where graphite service runs.";
|
||||
type = types.str;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue