From 0c57bcadd6aee77cf1edc6b33b2fef6250545fc8 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 7 Oct 2024 13:03:09 +0800 Subject: [PATCH] hosts/plover/services/crowdsec: init prototype --- configs/nixos/plover/modules/default.nix | 1 + .../plover/modules/services/crowdsec.nix | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 configs/nixos/plover/modules/services/crowdsec.nix diff --git a/configs/nixos/plover/modules/default.nix b/configs/nixos/plover/modules/default.nix index 15046fbb..e85a330d 100644 --- a/configs/nixos/plover/modules/default.nix +++ b/configs/nixos/plover/modules/default.nix @@ -30,6 +30,7 @@ ./services/fail2ban.nix ./services/gitea.nix ./services/grafana.nix + ./services/crowdsec.nix ./services/monitoring.nix ./services/vouch-proxy.nix ./services/vaultwarden.nix diff --git a/configs/nixos/plover/modules/services/crowdsec.nix b/configs/nixos/plover/modules/services/crowdsec.nix new file mode 100644 index 00000000..0d34376f --- /dev/null +++ b/configs/nixos/plover/modules/services/crowdsec.nix @@ -0,0 +1,22 @@ +{ config, lib, ... }: + +let + hostCfg = config.hosts.plover; + cfg = hostCfg.services.crowdsec; +in +{ + options.hosts.plover.services.crowdsec.enable = + lib.mkEnableOption "Crowdsec service"; + + config = lib.mkIf cfg.enable { + services.crowdsec = { + enable = true; + settings = { + common = { + daemonize = false; + log_media = "stdout"; + }; + }; + }; + }; +}