0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 21:50:33 +03:00

pkgs/top-level/config.nix: add options.allowNonSource

This commit is contained in:
éclairevoyant 2024-07-28 21:37:30 -04:00
parent f24c3a7f8e
commit 1899a02870
No known key found for this signature in database
GPG key ID: E3813AEAA02DB54B
2 changed files with 11 additions and 1 deletions

View file

@ -55,7 +55,7 @@ let
envVar = builtins.getEnv "NIXPKGS_ALLOW_NONSOURCE";
in if envVar != ""
then envVar != "0"
else config.allowNonSource or true;
else config.allowNonSource;
allowlist = config.allowlistedLicenses or config.whitelistedLicenses or [];
blocklist = config.blocklistedLicenses or config.blacklistedLicenses or [];

View file

@ -12,6 +12,7 @@ let
inherit (lib)
literalExpression
mapAttrsToList
mkEnableOption
mkOption
optionals
types
@ -107,6 +108,15 @@ let
'';
};
allowNonSource = mkEnableOption "" // {
default = true;
defaultText = literalExpression ''true && builtins.getEnv "NIXPKGS_ALLOW_NONSOURCE" != "0"'';
description = ''
Whether to allow non-source packages.
Can be combined with `config.allowNonSourcePredicate`.
'';
};
allowBroken = mkOption {
type = types.bool;
default = false;