# nixpkgs.config.permittedInsecurePackages cannot be set in multiple files at the same time

**URL:** https://discourse.nixos.org/t/nixpkgs-config-permittedinsecurepackages-cannot-be-set-in-multiple-files-at-the-same-time/56128
**Category:** Help
**Created:** [November 16, 2024, 7:06pm UTC](https://discourse.nixos.org/t/nixpkgs-config-permittedinsecurepackages-cannot-be-set-in-multiple-files-at-the-same-time/56128 "2024-11-16T19:06:25Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![husky](https://discourse.nixos.org/user_avatar/discourse.nixos.org/husky/32/29442_2.png) [@husky](https://discourse.nixos.org/u/husky)
#### Post date: [November 16, 2024, 7:06pm UTC](https://discourse.nixos.org/t/nixpkgs-config-permittedinsecurepackages-cannot-be-set-in-multiple-files-at-the-same-time/56128/1 "2024-11-16T19:06:25Z")

</div>

Basically `nixpkgs.config.permittedInsecurePackages` cannot be defined in multiple files at the same time, when this happens the value in the first file get silently picked.

Here’s a minimal configuration to reproduce [https://github.com/huskyistaken/nix-bad-vine-boom](https://github.com/huskyistaken/nix-bad-vine-boom).

You’ll notice that when switching the order module 1 and module 2 are declared in the flake the package changes.

I’ve tested this both with Nix v.2.18.8 and Lix v.2.91.0.

I’m not familiar enough with how things work under the hood to understand whether this is a parser bug or a nixpkgs bug, where should I report it?

---

<div class="post-metadata">

### Author: ![winter](https://discourse.nixos.org/user_avatar/discourse.nixos.org/winter/32/6816_2.png) [@winter](https://discourse.nixos.org/u/winter)
#### Post date: [November 16, 2024, 7:14pm UTC](https://discourse.nixos.org/t/nixpkgs-config-permittedinsecurepackages-cannot-be-set-in-multiple-files-at-the-same-time/56128/2 "2024-11-16T19:14:42Z")

</div>

> [@husky](#):
>
> I’m not familiar enough with how things work under the hood to understand whether this is a parser bug or a nixpkgs bug, where should I report it?

This isn’t a parser bug. Nixpkgs does the merging of option values.

N.B. I’m not even sure if this can be considered a bug in `configType`, or expected behavior. If others don’t chime in here, feel free to file an issue I suppose.

---

<div class="post-metadata">

### Author: ![stereomato](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/s/d6d6ee/32.png) [@stereomato](https://discourse.nixos.org/u/stereomato)
#### Post date: [January 12, 2025, 4:29am UTC](https://discourse.nixos.org/t/nixpkgs-config-permittedinsecurepackages-cannot-be-set-in-multiple-files-at-the-same-time/56128/3 "2025-01-12T04:29:03Z")

</div>

I just got bit by this.

---

<div class="post-metadata">

### Author: ![husky](https://discourse.nixos.org/user_avatar/discourse.nixos.org/husky/32/29442_2.png) [@husky](https://discourse.nixos.org/u/husky)
#### Post date: [January 12, 2025, 11:00am UTC](https://discourse.nixos.org/t/nixpkgs-config-permittedinsecurepackages-cannot-be-set-in-multiple-files-at-the-same-time/56128/4 "2025-01-12T11:00:41Z")

</div>

I opened an issue on the GitHub, and a [PR got made](https://github.com/NixOS/nixpkgs/pull/368051) to fix this. It’s still unmeged however.

---

<div class="post-metadata">

### Author: ![waffle8946](https://discourse.nixos.org/user_avatar/discourse.nixos.org/waffle8946/32/27221_2.png) [@waffle8946](https://discourse.nixos.org/u/waffle8946)
#### Post date: [January 12, 2025, 1:16pm UTC](https://discourse.nixos.org/t/nixpkgs-config-permittedinsecurepackages-cannot-be-set-in-multiple-files-at-the-same-time/56128/5 "2025-01-12T13:16:52Z")

</div>

The bug is because the option is not declared with `mkOption`. If it was declared then this custom merging would be unnecessary, and the option would actually become documented (!) in the nixpkgs config reference documentation.
