diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 4d49c32d1..b897cc516 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -304,6 +304,8 @@ /modules/services/notify-osd.nix @imalison +/modules/services/opensnitch-ui.nix @onny + /modules/services/pantalaimon.nix @jojosch /tests/modules/services/pantalaimon @jojosch diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index 0a88c6645..d3bd599ff 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -133,11 +133,16 @@ github = "hawkw"; githubId = 2796466; }; - pamplemousse = { name = "Xavier Maso"; email = "xav.maso@gmail.com"; github = "pamplemousse"; githubId = 2647236; }; + onny = { + name = "onny"; + email = "onny@project-insanity.org"; + github = "onny"; + githubId = 757752; + }; } diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 15297915d..19957f9cf 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -2312,6 +2312,14 @@ in A new module is available: 'services.gromit-mpx'. ''; } + + { + time = "2021-12-12T17:09:38+00:00"; + condition = hostPlatform.isLinux; + message = '' + A new module is available: 'services.opensnitch-ui'. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index 6d7ea4a7a..49a13c3ca 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -196,6 +196,7 @@ let ./services/network-manager-applet.nix ./services/nextcloud-client.nix ./services/notify-osd.nix + ./services/opensnitch-ui.nix ./services/owncloud-client.nix ./services/pantalaimon.nix ./services/parcellite.nix diff --git a/modules/services/opensnitch-ui.nix b/modules/services/opensnitch-ui.nix new file mode 100644 index 000000000..a086554ca --- /dev/null +++ b/modules/services/opensnitch-ui.nix @@ -0,0 +1,38 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + + cfg = config.services.opensnitch-ui; + +in { + + meta.maintainers = [ maintainers.onny ]; + + options = { + services.opensnitch-ui = { enable = mkEnableOption "Opensnitch client"; }; + }; + + config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.opensnitch-ui" pkgs + lib.platforms.linux) + ]; + + systemd.user.services.opensnitch-ui = { + Unit = { + Description = "Opensnitch ui"; + After = [ "graphical-session-pre.target" ]; + PartOf = [ "graphical-session.target" ]; + }; + + Service = { + Environment = "PATH=${config.home.profileDirectory}/bin"; + ExecStart = "${pkgs.opensnitch-ui}/bin/opensnitch-ui"; + }; + + Install = { WantedBy = [ "graphical-session.target" ]; }; + }; + }; +}