config.allowUnsupportedSystem: define as option

This commit is contained in:
Artturin 2022-05-02 20:39:43 +03:00
parent 9f473092f8
commit 9f05fc6661
2 changed files with 14 additions and 1 deletions

View file

@ -37,7 +37,7 @@ let
allowBroken = config.allowBroken
|| builtins.getEnv "NIXPKGS_ALLOW_BROKEN" == "1";
allowUnsupportedSystem = config.allowUnsupportedSystem or false
allowUnsupportedSystem = config.allowUnsupportedSystem
|| builtins.getEnv "NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM" == "1";
isUnfree = licenses: lib.lists.any (l: !l.free or true) licenses;

View file

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