nixpkgs.config: Add allowUnfreePackages option (#1742)

This commit is contained in:
Sam 2026-05-17 16:55:09 +00:00 committed by GitHub
commit 56c666e108
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 51 additions and 2 deletions

View file

@ -17,10 +17,13 @@ let
mergeConfig =
lhs_: rhs_:
let
lhs = optCall lhs_ { inherit pkgs; };
rhs = optCall rhs_ { inherit pkgs; };
lhs = optCall lhs_ { inherit lib pkgs; };
rhs = optCall rhs_ { inherit lib pkgs; };
in
lib.recursiveUpdate lhs rhs
// lib.optionalAttrs (lhs ? allowUnfreePackages) {
allowUnfreePackages = lhs.allowUnfreePackages ++ (lib.attrByPath [ "allowUnfreePackages" ] [ ] rhs);
}
// lib.optionalAttrs (lhs ? packageOverrides) {
packageOverrides =
pkgs: