NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.39k stars 14.34k forks source link

opensnitch: Setting `services.opensnitch.settings.ProcMonitorMethod` causes error #330935

Open sedrubal opened 4 months ago

sedrubal commented 4 months ago

Describe the bug

Setting the option services.opensnitch.settings.ProcMonitorMethod to something else then "ebpf" brings this error:

A definition for option `services.opensnitch.settings.Ebpf.ModulesPath' is not of type `path'

Steps To Reproduce

Steps to reproduce the behavior:

  1. Sett `services.opensnitch.settings.ProcMonitorMethod = "proc";
  2. rebuild

Expected behavior

The config option services.opensnitch.settings.Ebpf.ModulesPath should be ignored in this case.

Notify maintainers

@onny @stuebinm

Metadata

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.32-hardened1, NixOS, 24.05 (Uakari), 24.05.20240727.8c50662`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.5`
 - channels(root): `"home-manager-24.05.tar.gz, nixos-24.05, nixos-unstable"`
 - channels(se): `""`
 - nixpkgs: `/nix/store/d6533m6b80n3c9lia5kvaz59ad3fynwk-source
sedrubal commented 4 months ago

A workaround is to add this to the nixos config:

services.opensnitch.settings.Ebpf.ModulesPath = lib.mkForce "${config.boot.kernelPackages.opensnitch-ebpf}/etc/opensnitchd";