grimm-nixos-laptop/hardening/opensnitch/default.nix

56 lines
1.1 KiB
Nix
Raw Normal View History

2024-10-05 12:11:14 +02:00
{
pkgs,
config,
lib,
...
}:
let
2024-11-23 17:06:12 +01:00
inherit (config.grimmShared)
enable
tooling
graphical
network
;
2024-10-05 12:11:14 +02:00
inherit (lib)
optional
mkIf
;
in
{
2025-01-27 11:04:23 +01:00
imports = [
./vesktop.nix
./nix.nix
./spotify.nix
./global.nix
./time.nix
./osu.nix
./cups.nix
./network_support.nix
./firefox.nix
./tooling.nix
2025-01-28 19:54:36 +01:00
./dns.nix
2025-01-27 11:04:23 +01:00
];
2024-10-12 11:49:48 +02:00
config = mkIf (enable && tooling.enable && network) {
2024-10-05 12:11:14 +02:00
environment.systemPackages = optional graphical pkgs.opensnitch-ui;
grimmShared.sway.config.autolaunch = optional graphical pkgs.opensnitch-ui;
2025-01-11 11:54:34 +01:00
networking.nftables.enable = true;
2024-11-23 17:06:12 +01:00
2025-01-11 11:54:34 +01:00
# security.audit.enable = true;
2025-01-11 14:41:03 +01:00
systemd.services.opensnitchd.path = lib.optional (
config.services.opensnitch.settings.ProcMonitorMethod == "audit"
) pkgs.audit.bin;
2024-10-05 12:11:14 +02:00
services.opensnitch = {
enable = true;
settings = {
DefaultAction = "deny";
2025-01-11 11:54:34 +01:00
Firewall = if config.networking.nftables.enable then "nftables" else "iptables";
2024-12-29 14:17:01 +01:00
ProcMonitorMethod = "ftrace";
# ProcMonitorMethod = "audit";
2024-10-05 12:11:14 +02:00
};
};
};
}