mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-18 19:03:28 +00:00
check-meta: rename local binding
This commit is contained in:
parent
396629c7b6
commit
dbef1af49e
@ -46,7 +46,7 @@ let
|
||||
# import <nixpkgs> { config = { showDerivationWarnings = [ "maintainerless" ]; }; }
|
||||
showWarnings = config.showDerivationWarnings;
|
||||
|
||||
getName = attrs: attrs.name or ("${attrs.pname or "«name-missing»"}-${attrs.version or "«version-missing»"}");
|
||||
getNameWithVersion = attrs: attrs.name or ("${attrs.pname or "«name-missing»"}-${attrs.version or "«version-missing»"}");
|
||||
|
||||
allowUnfree = config.allowUnfree
|
||||
|| builtins.getEnv "NIXPKGS_ALLOW_UNFREE" == "1";
|
||||
@ -123,7 +123,7 @@ let
|
||||
!allowUnfree &&
|
||||
!allowUnfreePredicate attrs;
|
||||
|
||||
allowInsecureDefaultPredicate = x: builtins.elem (getName x) (config.permittedInsecurePackages or []);
|
||||
allowInsecureDefaultPredicate = x: builtins.elem (getNameWithVersion x) (config.permittedInsecurePackages or []);
|
||||
allowInsecurePredicate = x: (config.allowInsecurePredicate or allowInsecureDefaultPredicate) x;
|
||||
|
||||
hasAllowedInsecure = attrs:
|
||||
@ -230,23 +230,23 @@ let
|
||||
|
||||
$ export NIXPKGS_ALLOW_INSECURE=1
|
||||
${flakeNote}
|
||||
b) for `nixos-rebuild` you can add ‘${getName attrs}’ to
|
||||
b) for `nixos-rebuild` you can add ‘${getNameWithVersion attrs}’ to
|
||||
`nixpkgs.config.permittedInsecurePackages` in the configuration.nix,
|
||||
like so:
|
||||
|
||||
{
|
||||
nixpkgs.config.permittedInsecurePackages = [
|
||||
"${getName attrs}"
|
||||
"${getNameWithVersion attrs}"
|
||||
];
|
||||
}
|
||||
|
||||
c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
|
||||
‘${getName attrs}’ to `permittedInsecurePackages` in
|
||||
‘${getNameWithVersion attrs}’ to `permittedInsecurePackages` in
|
||||
~/.config/nixpkgs/config.nix, like so:
|
||||
|
||||
{
|
||||
permittedInsecurePackages = [
|
||||
"${getName attrs}"
|
||||
"${getNameWithVersion attrs}"
|
||||
];
|
||||
}
|
||||
|
||||
@ -257,9 +257,9 @@ let
|
||||
actualOutputs = attrs.outputs or [ "out" ];
|
||||
missingOutputs = builtins.filter (output: ! builtins.elem output actualOutputs) expectedOutputs;
|
||||
in ''
|
||||
The package ${getName attrs} has set meta.outputsToInstall to: ${builtins.concatStringsSep ", " expectedOutputs}
|
||||
The package ${getNameWithVersion attrs} has set meta.outputsToInstall to: ${builtins.concatStringsSep ", " expectedOutputs}
|
||||
|
||||
however ${getName attrs} only has the outputs: ${builtins.concatStringsSep ", " actualOutputs}
|
||||
however ${getNameWithVersion attrs} only has the outputs: ${builtins.concatStringsSep ", " actualOutputs}
|
||||
|
||||
and is missing the following ouputs:
|
||||
|
||||
@ -269,9 +269,9 @@ let
|
||||
handleEvalIssue = { meta, attrs }: { reason , errormsg ? "" }:
|
||||
let
|
||||
msg = if inHydra
|
||||
then "Failed to evaluate ${getName attrs}: «${reason}»: ${errormsg}"
|
||||
then "Failed to evaluate ${getNameWithVersion attrs}: «${reason}»: ${errormsg}"
|
||||
else ''
|
||||
Package ‘${getName attrs}’ in ${pos_str meta} ${errormsg}, refusing to evaluate.
|
||||
Package ‘${getNameWithVersion attrs}’ in ${pos_str meta} ${errormsg}, refusing to evaluate.
|
||||
|
||||
'' + (builtins.getAttr reason remediation) attrs;
|
||||
|
||||
@ -283,8 +283,8 @@ let
|
||||
handleEvalWarning = { meta, attrs }: { reason , errormsg ? "" }:
|
||||
let
|
||||
remediationMsg = (builtins.getAttr reason remediation) attrs;
|
||||
msg = if inHydra then "Warning while evaluating ${getName attrs}: «${reason}»: ${errormsg}"
|
||||
else "Package ${getName attrs} in ${pos_str meta} ${errormsg}, continuing anyway."
|
||||
msg = if inHydra then "Warning while evaluating ${getNameWithVersion attrs}: «${reason}»: ${errormsg}"
|
||||
else "Package ${getNameWithVersion attrs} in ${pos_str meta} ${errormsg}, continuing anyway."
|
||||
+ (optionalString (remediationMsg != "") "\n${remediationMsg}");
|
||||
isEnabled = findFirst (x: x == reason) null showWarnings;
|
||||
in if isEnabled != null then builtins.trace msg true else true;
|
||||
|
Loading…
Reference in New Issue
Block a user