I’ve been trying to update my system (which is flake-based, and uses home-manager, if that matters), and have been encountering some ..strange errors:
The error
error:
… while calling the 'head' builtin
at «github:nixos/nixpkgs/753cc8a3a87467296ddd1fa93f0cc3e81120ee46?narHash=sha256-KesHgItiZPgGX740axSiQLcIQ8D24MDqNpkKYWIek8k%3D»/lib/attrsets.nix:1719:13:
1718| if length values == 1 || pred here (elemAt values 1) (head values) then
1719| head values
| ^
1720| else
… while evaluating the attribute 'value'
at «github:nixos/nixpkgs/753cc8a3a87467296ddd1fa93f0cc3e81120ee46?narHash=sha256-KesHgItiZPgGX740axSiQLcIQ8D24MDqNpkKYWIek8k%3D»/lib/modules.nix:1149:7:
1148| // {
1149| value = addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
1150| inherit (res.defsFinal') highestPrio;
… while evaluating the option `system.build.toplevel':
… while evaluating definitions from `/nix/store/7hlsbdxjq2mgczhlipabzn52sarzx0yd-source/nixos/modules/system/activation/top-level.nix':
… while evaluating the option `warnings':
… while evaluating definitions from `/nix/store/7hlsbdxjq2mgczhlipabzn52sarzx0yd-source/nixos/modules/system/boot/systemd.nix':
… while evaluating the option `systemd.services.home-manager-flyxx.serviceConfig':
… while evaluating definitions from `/nix/store/j7lmjk2qc9nlwfjy6afbhnwr8krkck1c-source/nixos':
… while evaluating the option `home-manager.users.flyxx.home.file."/home/flyxx/.config/fontconfig/conf.d/10-hm-fonts.conf".source':
… while evaluating definitions from `/nix/store/j7lmjk2qc9nlwfjy6afbhnwr8krkck1c-source/modules/misc/xdg':
… while evaluating the option `home-manager.users.flyxx.xdg.configFile."fontconfig/conf.d/10-hm-fonts.conf".source':
… while evaluating definitions from `/nix/store/j7lmjk2qc9nlwfjy6afbhnwr8krkck1c-source/modules/misc/fontconfig.nix':
… while evaluating the option `home-manager.users.flyxx.fonts.fontconfig.configFile.fonts.source':
… while evaluating definitions from `/nix/store/j7lmjk2qc9nlwfjy6afbhnwr8krkck1c-source/modules/misc/fontconfig.nix':
… while evaluating the option `home-manager.users.flyxx.fonts.fontconfig.configFile.fonts.settings':
… while evaluating definitions from `/nix/store/j7lmjk2qc9nlwfjy6afbhnwr8krkck1c-source/modules/misc/fontconfig.nix':
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error: Refusing to evaluate package 'electron-40.10.5' in /nix/store/7hlsbdxjq2mgczhlipabzn52sarzx0yd-source/pkgs/develo
pment/tools/electron/binary/generic.nix:50 because it is marked as insecure
Known issues:
- Electron version 40.10.5 is EOL
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 ‘electron-40.10.5’ to
`nixpkgs.config.permittedInsecurePackages` in the configuration.nix,
like so:
{
nixpkgs.config.permittedInsecurePackages = [
"electron-40.10.5"
];
}
c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
‘electron-40.10.5’ to `permittedInsecurePackages` in
~/.config/nixpkgs/config.nix, like so:
{
permittedInsecurePackages = [
"electron-40.10.5"
];
}
(this being after running nix flake update --flake ., and then nixos-rebuild boot.)
I am confused, because first of all, the error is coming from something Fontconfig-related (or at least, that is the base ). This feels like a highly unintuitive origin of such a dependency, to put it lightly.
Second, accepting the premise that somehow Fontconfig relies on Electron: I took a look at the source code being evaluated, and there is ..no mention of Electron. Anywhere. (That being said, it is possible that I maybe just didn’t look hard enough, of course. But somehow I doubt that, because Electron dependencies in Fontconfig make zero sense to me.)
Third: I don’t even configure Fontconfig in home-manager, and I certainly don’t configure it to rely on Electron. And as mentioned, none of the relevant source files seem to ever mention Electron..? (Maybe something else at some point configures something Fontconfig-related, but in that case, why doesn’t that appear in the stack trace?)
I want to avoid just adding Electron to permittedInsecurePackages, because that feels like a problem waiting to happen, especially given that I have no idea where this dependency on Electron is even coming from.
Does anyone know anything about this? I’m so confused.