Skip to content

nixpkgs.config option having unintuitive merging semantic #468647

@leana8959

Description

@leana8959

nixpkgs.config is not subject to the normal merging lib.mkMerge semantic.

{
  imports = [
    { nixpkgs.config.allowUnfreePredicate = x: false; }
    { nixpkgs.config.allowUnfreePredicate = x: true; }
  ];
}

The snippet above would evaluate to nixpkgs.config.allowUnfreePredicate = false instead of saying the option has been defined multiple times.

Furthermore I would like to see this option being merged with lib.types.functionTo lib.types.boolByOr, so we merge these definitions point-wise returning true on any predicate satisfied.

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: enhancementAdd something new or improve an existing system.6.topic: architectureRelating to code and API architecture of Nixpkgs

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions