I use my NixOS drive through an external M.2, and so I use it on various devices. When I use it on a Macbook Pro, the WiFi card needs me to enable broadcom-sta-6.30.223.271-59-7.1.1 drivers, so I have it written in my configuration as a permitted package.
However, because these drivers tend to change/update to newer versions, I usually meet this error every month:
error: Refusing to evaluate package 'broadcom-sta-6.30.223.271-59-7.1.1' in /nix/store/kyxkqg6wydr9c3g87503spqa1mbr7q70-nixos-26.05/nixos/pkgs/os-specific/linux/broadcom-sta/default.nix:106 because it is marked as insecure
Known issues:
- CVE-2019-9501: heap buffer overflow, potentially allowing remote code execution by sending specially-crafted WiFi packets
- CVE-2019-9502: heap buffer overflow, potentially allowing remote code execution by sending specially-crafted WiFi packets
- The Broadcom STA wireless driver is not maintained and is incompatible with Linux kernel security mitigations. It is heavily recommended to replace the hardware and remove the driver. Proceed at your own risk!
You can install it anyway by allowing this package, using the
following methods:
a) To temporarily allow all insecure packages, you can use an environment
variable for a single invocation of the nix tools:
$ export NIXPKGS_ALLOW_INSECURE=1
Note: When using `nix shell`, `nix build`, `nix develop`, etc with a flake,
then pass `--impure` in order to allow use of environment variables.
b) for `nixos-rebuild` you can add ‘broadcom-sta-6.30.223.271-59-7.1.1’ to
`nixpkgs.config.permittedInsecurePackages` in the configuration.nix,
like so:
{
nixpkgs.config.permittedInsecurePackages = [
"broadcom-sta-6.30.223.271-59-7.1.1"
];
}
c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
‘broadcom-sta-6.30.223.271-59-7.1.1’ to `permittedInsecurePackages` in
~/.config/nixpkgs/config.nix, like so:
{
permittedInsecurePackages = [
"broadcom-sta-6.30.223.271-59-7.1.1"
];
}
Command 'nix-build '<nixpkgs/nixos>' --attr config.system.build.toplevel --no-out-link' returned non-zero exit status 1.
I’ve though of writing the permitted package with an *, as a way to include any future releases, such as by inputting:
permittedInsecurePackages = [
"broadcom-sta-6.30.223.271-59-7.1.*"
But that doesn’t work.
Is there something I can write that will continue to have a package update, regardless of its version?
Would broadcom-sta work on its own, without a version number?