Merge pull request #175265 from hercules-ci/issue-175196

Fix issue #175196, infinite recursion in pkgs/config.nix
This commit is contained in:
Robert Hensing 2022-05-29 10:53:31 +02:00 committed by GitHub
commit e8e9cebbda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 1 deletions

21
pkgs/test/config.nix Normal file
View File

@ -0,0 +1,21 @@
{ lib, ... }:
lib.recurseIntoAttrs {
# https://github.com/NixOS/nixpkgs/issues/175196
allowPkgsInPermittedInsecurePackages =
let pkgs = import ../.. {
config = {
permittedInsecurePackages =
tempAllow pkgs.authy "2.1.0" [ "electron-9.4.4" ];
};
};
# Allow with forgetting
tempAllow = p: v: pa:
lib.optionals (lib.assertMsg (p.version == v) "${p.name} is no longer at version ${v}, consider removing the tempAllow") pa;
# For this test we don't _really_ care about the version though,
# only about evaluation strictness
tempAllowAlike = p: v: pa: builtins.seq v builtins.seq p.version pa;
in pkgs.hello;
}

View File

@ -22,6 +22,8 @@ with pkgs;
cc-wrapper-libcxx-9 = callPackage ./cc-wrapper { stdenv = llvmPackages_9.libcxxStdenv; };
stdenv-inputs = callPackage ./stdenv-inputs { };
config = callPackage ./config.nix { };
haskell = callPackage ./haskell { };
cc-multilib-gcc = callPackage ./cc-wrapper/multilib.nix { stdenv = gccMultiStdenv; };

View File

@ -128,7 +128,7 @@ let
in {
freeformType =
let t = lib.types.attrsOf lib.types.raw;
let t = lib.types.lazyAttrsOf lib.types.raw;
in t // {
merge = loc: defs:
let r = t.merge loc defs;