Fix bug for non-home-manager machine

This commit is contained in:
Victor Mignot 2024-08-03 22:32:36 +02:00
parent a5dee47f5b
commit 75f0cb6112
Signed by: dala
GPG key ID: 5E7F2CE1BEAFED3D

View file

@ -1,9 +1,4 @@
{
config,
lib,
machineProps,
...
}:
{ config, machineProps, ... }:
let
anyWiresharkUser =
if machineProps.enableHomeManager then
@ -15,11 +10,19 @@ let
userUseWireshark = value: value.my.development.tools.networking.enable;
in
{
config = {
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
{ }
);
}