38 lines
922 B
Nix
38 lines
922 B
Nix
{
|
|
inputs,
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
system,
|
|
...
|
|
}:
|
|
let
|
|
cfg = config.hardware.t2-mac-WirelessReload;
|
|
in
|
|
{
|
|
options.hardware.t2-mac-WirelessReload.enable = lib.mkOption {
|
|
type = with lib.types; uniq bool;
|
|
default = false;
|
|
description = "Reloads the Wireless Drivers";
|
|
};
|
|
|
|
config = lib.mkIf (cfg.enable) {
|
|
# Service to load Driver with options
|
|
systemd.services."t2-mac-WirelessReload" = {
|
|
description = "Reloads Wireless Drivers for Mac";
|
|
path = [ pkgs.kmod ];
|
|
serviceConfig = {
|
|
Type = "oneshot";
|
|
ExecStart = ''
|
|
${pkgs.kmod.out}/bin/modprobe -r brcmfmac_wcc || true
|
|
${pkgs.kmod.out}/bin/modprobe -r brcmfmac || true
|
|
${pkgs.kmod.out}/bin/modprobe brcmfmac || true
|
|
${pkgs.kmod.out}/bin/modprobe -r hci_bcm4377 || true
|
|
${pkgs.kmod.out}/bin/modprobe hci_bcm4377 || true
|
|
'';
|
|
};
|
|
wantedBy = [ "multi-user.target" ];
|
|
};
|
|
};
|
|
}
|
|
|