pkgs.tests: Add regression test for #175196

This commit is contained in:
Robert Hensing 2022-05-29 10:23:16 +02:00
parent 858a212314
commit 523eb4a181
2 changed files with 23 additions and 0 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; };