about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2022-10-06 16:23:48 +0200
committerRobert Hensing <robert@roberthensing.nl>2022-10-06 16:43:07 +0200
commited5aa53f451ee1bea1922f8ffa9e2f3b73280723 (patch)
tree195ac5a663393c4df3f91df4405c76f31998c86f
parent5699ff529ad9d5959a4584531e242b5ab86a3889 (diff)
nixos/matamo: Refactor to use config.networking.fqdnOrHostName
-rw-r--r--nixos/modules/services/web-apps/matomo.nix8
1 files changed, 2 insertions, 6 deletions
diff --git a/nixos/modules/services/web-apps/matomo.nix b/nixos/modules/services/web-apps/matomo.nix
index 9e8d85161da76..117d540ba36b1 100644
--- a/nixos/modules/services/web-apps/matomo.nix
+++ b/nixos/modules/services/web-apps/matomo.nix
@@ -12,8 +12,6 @@ let
   phpExecutionUnit = "phpfpm-${pool}";
   databaseService = "mysql.service";
 
-  fqdn = if config.networking.domain != null then config.networking.fqdn else config.networking.hostName;
-
 in {
   imports = [
     (mkRenamedOptionModule [ "services" "piwik" "enable" ] [ "services" "matomo" "enable" ])
@@ -77,11 +75,9 @@ in {
 
       hostname = mkOption {
         type = types.str;
-        default = "${user}.${fqdn}";
+        default = "${user}.${config.networking.fqdnOrHostName}";
         defaultText = literalExpression ''
-          if config.${options.networking.domain} != null
-          then "${user}.''${config.${options.networking.fqdn}}"
-          else "${user}.''${config.${options.networking.hostName}}"
+          "${user}.''${config.${options.networking.fqdnOrHostName}}"
         '';
         example = "matomo.yourdomain.org";
         description = lib.mdDoc ''