diff options
author | Felix Buehler | 2024-08-24 22:05:49 +0200 |
---|---|---|
committer | Felix Buehler | 2024-08-30 23:00:53 +0200 |
commit | 42bdc30f19a40cf41fba5ad4a6711a28e5cfd062 (patch) | |
tree | 2c04ffb714032b401848863553275b094ed5f13c /nixos | |
parent | e00ab2106aca2fd4bdb0524f969cf46fb6622ccb (diff) |
nixos/services.n8n: remove `with lib;`
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/misc/n8n.nix | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/nixos/modules/services/misc/n8n.nix b/nixos/modules/services/misc/n8n.nix index 231470b9937a..623c9a3be8a9 100644 --- a/nixos/modules/services/misc/n8n.nix +++ b/nixos/modules/services/misc/n8n.nix @@ -1,7 +1,4 @@ { config, pkgs, lib, ... }: - -with lib; - let cfg = config.services.n8n; format = pkgs.formats.json {}; @@ -9,15 +6,15 @@ let in { options.services.n8n = { - enable = mkEnableOption "n8n server"; + enable = lib.mkEnableOption "n8n server"; - openFirewall = mkOption { - type = types.bool; + openFirewall = lib.mkOption { + type = lib.types.bool; default = false; description = "Open ports in the firewall for the n8n web interface."; }; - settings = mkOption { + settings = lib.mkOption { type = format.type; default = {}; description = '' @@ -26,8 +23,8 @@ in ''; }; - webhookUrl = mkOption { - type = types.str; + webhookUrl = lib.mkOption { + type = lib.types.str; default = ""; description = '' WEBHOOK_URL for n8n, in case we're running behind a reverse proxy. @@ -37,7 +34,7 @@ in }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { services.n8n.settings = { # We use this to open the firewall, so we need to know about the default at eval time port = lib.mkDefault 5678; @@ -85,7 +82,7 @@ in }; }; - networking.firewall = mkIf cfg.openFirewall { + networking.firewall = lib.mkIf cfg.openFirewall { allowedTCPPorts = [ cfg.settings.port ]; }; }; |