config.allowBroken: define as option

This commit is contained in:
Artturin 2022-05-02 17:20:44 +03:00
parent 1c49b81263
commit 9f473092f8
2 changed files with 12 additions and 1 deletions

View file

@ -34,7 +34,7 @@ let
hasBlocklistedLicense = assert areLicenseListsValid; attrs:
hasLicense attrs && lib.lists.any (l: builtins.elem l blocklist) (lib.lists.toList attrs.meta.license);
allowBroken = config.allowBroken or false
allowBroken = config.allowBroken
|| builtins.getEnv "NIXPKGS_ALLOW_BROKEN" == "1";
allowUnsupportedSystem = config.allowUnsupportedSystem or false

View file

@ -70,6 +70,17 @@ let
'';
};
allowBroken = mkOption {
type = types.bool;
default = false;
# getEnv part is in check-meta.nix
defaultText = literalExpression ''false || builtins.getEnv "NIXPKGS_ALLOW_BROKEN" == "1"'';
description = ''
Whether to allow broken packages.
See <link xlink:href="https://nixos.org/manual/nixpkgs/stable/#sec-allow-broken">Installing broken packages</link> in the NixOS manual.
'';
};
};
in {