-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
Open
Labels
0.kind: bugSomething is brokenSomething is broken2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.mdhttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md
Description
Describe the bug
Attempt to add overlay lib have effect only on pkgs module argument attrset and not on lib.
Steps To Reproduce
Steps to reproduce the behavior:
- Prepare dummy NixOS configuration
# flake.nix
{
outputs = { nixpkgs, ... }@inputs: with inputs; {
nixosConfigurations.ony = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
modules = [ ./configuration.nix ];
};
defaultPackage.x86_64-linux = self.nixosConfigurations.ony.config.system.build.toplevel;
};
}{ lib, pkgs, ... }:
{
nixpkgs.overlays = [
(final: prev: {
lib = prev.lib // {
licenses = prev.lib.licenses // {
sspl = prev.lib.licenses.sspl // {
shortName = "sspl"; # try to fix upper case SSPL not matching attribute
};
};
};
})
];
nixpkgs.config = {
# blocklistedLicenses = with lib.licenses; [ sspl ]; # => ‘SSPL’ is not an attribute of lib.licenses
blocklistedLicenses = with pkgs.lib.licenses; [ sspl ]; # => ‘sspl’ is not an attribute of lib.licenses
};
}- Run
nix flake check
Expected behavior
- There should be no difference between using
liborpkgs(viapkgs.lib) arguments of module. - Overriding
libin overlay should have effect oncheck-meta.nixevaluations too. That message indicates that licenses referenced inblocklistedLicensesand in attrsetlib.licenseswere different even ifssplattribute was found. See comment for issue with SSPL.
Screenshots
When using lib.licenses (no effect from overlay)
zsh% nix flake check
error: ‘SSPL’ is not an attribute of lib.licenses
(use '--show-trace' to show detailed location information)
When using pkgs.lib.licenses (license do not match one referenced in check-meta.nix)
zsh% nix flake check
error: ‘sspl’ is not an attribute of lib.licenses
(use '--show-trace' to show detailed location information)
(notice lower case version of shortName)
Additional context
When there is requirement for blocklistedLicenses to reference only licenses from lib.licenses, we need a way extend that attrset to allow having packages and licenses outside of main nixpkgs repo.
Notify maintainers
Metadata
nix run nixpkgs\#nix-info -- -m- system:
"x86_64-linux" - host os:
Linux 5.10.81, NixOS, 21.11 (Porcupine) - multi-user?:
yes - sandbox:
yes - version:
nix-env (Nix) 2.4 - channels(root):
"nixos-21.11.334684.1158f346391" - channels(nikolay):
"nixpkgs-unstable-21.11pre310022.14b0f20fa1f" - nixpkgs:
/nix/var/nix/profiles/per-user/root/channels/nixos
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
0.kind: bugSomething is brokenSomething is broken2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.mdhttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md