From e67a646a925bc3cda86101a3f3afb81db3030ef5 Mon Sep 17 00:00:00 2001 From: pennae Date: Sun, 5 Dec 2021 22:56:22 +0100 Subject: treewide: add defaultText to remaining options these are mostly options that use alias bindings, bindings to constants, or bindings to calculated values. --- nixos/modules/services/web-apps/matomo.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'nixos/modules/services/web-apps/matomo.nix') diff --git a/nixos/modules/services/web-apps/matomo.nix b/nixos/modules/services/web-apps/matomo.nix index 318c4473b55..8a0ca33b51f 100644 --- a/nixos/modules/services/web-apps/matomo.nix +++ b/nixos/modules/services/web-apps/matomo.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, options, pkgs, ... }: with lib; let cfg = config.services.matomo; @@ -12,10 +12,7 @@ let phpExecutionUnit = "phpfpm-${pool}"; databaseService = "mysql.service"; - fqdn = - let - join = hostName: domain: hostName + optionalString (domain != null) ".${domain}"; - in join config.networking.hostName config.networking.domain; + fqdn = if config.networking.domain != null then config.networking.fqdn else config.networking.hostName; in { imports = [ @@ -81,6 +78,11 @@ in { hostname = mkOption { type = types.str; default = "${user}.${fqdn}"; + defaultText = literalExpression '' + if config.${options.networking.domain} != null + then "${user}.''${config.${options.networking.fqdn}}" + else "${user}.''${config.${options.networking.hostName}}" + ''; example = "matomo.yourdomain.org"; description = '' URL of the host, without https prefix. You may want to change it if you -- cgit 1.4.1