From 94f775024eec2cdf676ad1017a58660619fb3dd0 Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Sun, 1 Aug 2021 16:06:53 +0200 Subject: [PATCH] Opensnitch: Add module --- .../from_md/release-notes/rl-2111.section.xml | 7 ++++++ .../manual/release-notes/rl-2111.section.md | 2 ++ nixos/modules/module-list.nix | 1 + .../modules/services/security/opensnitch.nix | 24 +++++++++++++++++++ 4 files changed, 34 insertions(+) create mode 100644 nixos/modules/services/security/opensnitch.nix diff --git a/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml index 0cd293df40cd..e756ba2d8a3a 100644 --- a/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml +++ b/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml @@ -103,6 +103,13 @@ services.vikunja. + + + opensnitch, + an application firewall. Available as + services.opensnitch. + + snapraid, a diff --git a/nixos/doc/manual/release-notes/rl-2111.section.md b/nixos/doc/manual/release-notes/rl-2111.section.md index 3eefe138fb0d..0adddd05d494 100644 --- a/nixos/doc/manual/release-notes/rl-2111.section.md +++ b/nixos/doc/manual/release-notes/rl-2111.section.md @@ -32,6 +32,8 @@ pt-services.clipcat.enable). - [vikunja](https://vikunja.io), a to-do list app. Available as [services.vikunja](#opt-services.vikunja.enable). +- [opensnitch](https://github.com/evilsocket/opensnitch), an application firewall. Available as [services.opensnitch](#opt-services.opensnitch.enable). + - [snapraid](https://www.snapraid.it/), a backup program for disk arrays. Available as [snapraid](#opt-snapraid.enable). diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 1bb98efafd2d..a4721e7abec9 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -896,6 +896,7 @@ ./services/security/nginx-sso.nix ./services/security/oauth2_proxy.nix ./services/security/oauth2_proxy_nginx.nix + ./services/security/opensnitch.nix ./services/security/privacyidea.nix ./services/security/physlock.nix ./services/security/shibboleth-sp.nix diff --git a/nixos/modules/services/security/opensnitch.nix b/nixos/modules/services/security/opensnitch.nix new file mode 100644 index 000000000000..919346cf2bb1 --- /dev/null +++ b/nixos/modules/services/security/opensnitch.nix @@ -0,0 +1,24 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + name = "opensnitch"; + cfg = config.services.opensnitch; +in { + options = { + services.opensnitch = { + enable = mkEnableOption "Opensnitch application firewall"; + }; + }; + + config = mkIf cfg.enable { + + systemd = { + packages = [ pkgs.opensnitch ]; + services.opensnitchd.wantedBy = [ "multi-user.target" ]; + }; + + }; +} +