diff options
Diffstat (limited to 'modules/plausible.nix')
-rw-r--r-- | modules/plausible.nix | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/modules/plausible.nix b/modules/plausible.nix index 89729fd..94e0d9d 100644 --- a/modules/plausible.nix +++ b/modules/plausible.nix @@ -5,23 +5,22 @@ this, ... }: -with lib; let cfg = config.nixfiles.modules.plausible; in { options.nixfiles.modules.plausible = { - enable = mkEnableOption "Plausible Analytics"; + enable = lib.mkEnableOption "Plausible Analytics"; - port = mkOption { + port = lib.mkOption { description = "Port."; - type = with types; port; + type = lib.types.port; default = 8000; }; - domain = mkOption { + domain = lib.mkOption { description = "Domain name sans protocol scheme."; - type = with types; nullOr str; + type = with lib.types; nullOr str; default = "plausible.${config.networking.domain}"; }; }; @@ -30,7 +29,7 @@ in let db = "plausible"; in - mkIf cfg.enable { + lib.mkIf cfg.enable { _module.args.libPlausible = { htmlPlausibleScript = { @@ -88,12 +87,12 @@ in # }; mail = { - email = "admin+plausible@${my.domain.shire}"; + email = "webmaster@${lib.my.domain.shire}"; smtp = { - hostAddr = my.domain.shire; + hostAddr = lib.my.domain.shire; hostPort = 465; enableSSL = true; - user = "azahi@${my.domain.shire}"; + user = "azahi@${lib.my.domain.shire}"; passwordFile = config.secrets.plausible-smtp-password.path; }; }; @@ -127,13 +126,14 @@ in requires = after; }; - topology = with cfg; { - nodes.${this.hostname}.services.plausible = { - name = "Plausible"; - icon = "${inputs.homelab-svg-assets}/assets/plausible.svg"; - info = domain; - details.listen.text = "${config.services.plausible.server.listenAddress}:${toString port}"; - }; + topology.nodes.${this.hostname}.services.plausible = { + name = "Plausible"; + icon = "${inputs.homelab-svg-assets}/assets/plausible.svg"; + info = cfg.domain; + details.listen.text = lib.concatStringsSep ":" [ + config.services.plausible.server.listenAddress + (toString cfg.port) + ]; }; }; } |