Compare commits

...

2 commits

Author SHA1 Message Date
Victor Mignot 32b7a34b6f
Restrict Lix to x86 machines 2024-08-03 22:36:48 +02:00
Victor Mignot 75f0cb6112
Fix bug for non-home-manager machine 2024-08-03 22:32:36 +02:00
2 changed files with 18 additions and 13 deletions

View file

@ -65,7 +65,9 @@
{ ... }: { ... }:
{ {
imports = [ imports = [
lixModules.${config.nixpkgs}.nixosModules.default (
if (config.system == "x86_64-linux") then lixModules.${config.nixpkgs}.nixosModules.default else { }
)
./configurations/${name} ./configurations/${name}
(if config.enableHomeManager then home-manager.nixosModules.home-manager else { }) (if config.enableHomeManager then home-manager.nixosModules.home-manager else { })
(if (config.system == "x86_64-linux") then lanzaboote.nixosModules.lanzaboote else { }) (if (config.system == "x86_64-linux") then lanzaboote.nixosModules.lanzaboote else { })

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
{ }
);
} }