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, machineProps, ... }:
config,
lib,
machineProps,
...
}:
let let
anyWiresharkUser = anyWiresharkUser =
if machineProps.enableHomeManager then if machineProps.enableHomeManager then
@ -15,11 +10,19 @@ let
userUseWireshark = value: value.my.development.tools.networking.enable; userUseWireshark = value: value.my.development.tools.networking.enable;
in in
{ {
config = { config =
{
programs.wireshark.enable = anyWiresharkUser; programs.wireshark.enable = anyWiresharkUser;
}
// (
if machineProps.enableHomeManager then
{
users.users = builtins.mapAttrs (name: value: { users.users = builtins.mapAttrs (name: value: {
extraGroups = if (userUseWireshark value) then [ "wireshark" ] else [ ]; extraGroups = if (userUseWireshark value) then [ "wireshark" ] else [ ];
}) config.home-manager.users; }) config.home-manager.users;
}; }
else
{ }
);
} }