29 lines
702 B
Nix
29 lines
702 B
Nix
{ config, machineProps, ... }:
|
|
let
|
|
anyWiresharkUser =
|
|
if machineProps.enableHomeManager then
|
|
(builtins.any (user: user.my.development.tools.networking.enable) (
|
|
builtins.attrValues config.home-manager.users
|
|
))
|
|
else
|
|
false;
|
|
userUseWireshark = value: value.my.development.tools.networking.enable;
|
|
in
|
|
{
|
|
config =
|
|
{
|
|
programs.wireshark.enable = anyWiresharkUser;
|
|
|
|
}
|
|
// (
|
|
if machineProps.enableHomeManager then
|
|
{
|
|
users.users = builtins.mapAttrs (name: value: {
|
|
extraGroups = if (userUseWireshark value) then [ "wireshark" ] else [ ];
|
|
}) config.home-manager.users;
|
|
}
|
|
else
|
|
{ }
|
|
);
|
|
}
|