-
-
Notifications
You must be signed in to change notification settings - Fork 15k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib and pkgs.lib loose sync when trying to overlay lib #156312
Comments
It is not possible to override To evaluate To override the cc @ncfavier If we do make |
This is redundant. It's generally a good idea not to use it, especially in places where you can access the same values through a "fixed point" like the flake |
@ony so in your case, something like this should work: {
outputs = { nixpkgs, ... }@inputs: with inputs; let
lib = nixpkgs.lib.extend (final: prev: {
licenses = prev.licenses // {
sspl = prev.licenses.sspl // { shortName = "sspl"; };
};
});
in {
nixosConfigurations.ony = lib.nixosSystem {
inherit lib; # might become unnecessary in the future
system = "x86_64-linux";
modules = [ ({ lib, ... }: ... lib.licenses.sspl ...) ];
};
defaultPackage.x86_64-linux = self.nixosConfigurations.ony.config.system.build.toplevel;
};
} |
@ncfavier , thank you for Could it be because of this?
nixpkgs/pkgs/stdenv/generic/default.nix Line 54 in c4bb908
nixpkgs/pkgs/stdenv/generic/make-derivation.nix Lines 1 to 7 in c4bb908
|
I was thinking about that earlier. It seems like a complete solution would look like introducing a concept of an "ambient" |
I wonder if simple solution would be to not depend on @roberth , |
Opened #157056 |
Describe the bug
Attempt to add overlay
lib
have effect only onpkgs
module argument attrset and not onlib
.Steps To Reproduce
Steps to reproduce the behavior:
nix flake check
Expected behavior
lib
orpkgs
(viapkgs.lib
) arguments of module.lib
in overlay should have effect oncheck-meta.nix
evaluations too. That message indicates that licenses referenced inblocklistedLicenses
and in attrsetlib.licenses
were different even ifsspl
attribute was found. See comment for issue with SSPL.Screenshots
When using
lib.licenses
(no effect from overlay)When using
pkgs.lib.licenses
(license do not match one referenced incheck-meta.nix
)(notice lower case version of
shortName
)Additional context
When there is requirement for
blocklistedLicenses
to reference only licenses fromlib.licenses
, we need a way extend that attrset to allow having packages and licenses outside of mainnixpkgs
repo.Notify maintainers
Metadata
nix run nixpkgs\#nix-info -- -m
"x86_64-linux"
Linux 5.10.81, NixOS, 21.11 (Porcupine)
yes
yes
nix-env (Nix) 2.4
"nixos-21.11.334684.1158f346391"
"nixpkgs-unstable-21.11pre310022.14b0f20fa1f"
/nix/var/nix/profiles/per-user/root/channels/nixos
The text was updated successfully, but these errors were encountered: