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
some overrideDerivation cleanups #41732
Conversation
FWIW: https://github.com/NixOS/nixpkgs/pull/41165/files#r193124185 but I don't know why. |
Maybe he meant both overrideAttrs and overrideDerivation? No idea, but I won't let it worry me without an explanation :) The docs certainly favor overrideAttrs: https://nixos.org/nixpkgs/manual/#sec-pkg-overrideDerivation |
Yes, I believe this warning in the linked manual chapter applies to both:
|
version = "2.0.5"; | ||
isStable = true; | ||
sha256 = "0yg9q4q6v028bgh85317ykc9whgxgysp76qzaqgq55y6jy11yjw7"; | ||
} // { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be possible to not introduce overrideAttrs
here:
luajit_2_0 = generic {
version = "2.0.5";
isStable = true;
sha256 = "0yg9q4q6v028bgh85317ykc9whgxgysp76qzaqgq55y6jy11yjw7";
meta = meta // {
platforms = lib.filter (p: p != "aarch64-linux") meta.platforms;
};
generic = { ..., meta ? meta }:
stdenv.mkDerivation rec {
inherit name version src meta;
....
;
overrideAttrs
doesn't make this generative stuff cleaner IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. @infinisil can you adjust it as shown by @danbst?
I see no harm in replacing |
version = "2.0.5"; | ||
isStable = true; | ||
sha256 = "0yg9q4q6v028bgh85317ykc9whgxgysp76qzaqgq55y6jy11yjw7"; | ||
} // { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. @infinisil can you adjust it as shown by @danbst?
These four top-level packages were the only ones that didn't have the meta.position attribute automagically set. This commit fixes this.
fe55ce0
to
02f11bc
Compare
Fixed that, but I couldn't use |
oh right, forgot func args are implicilty |
|
|
||
postUnpack = '' | ||
echo -n "${version} (${releaseDate})" > ./i3-${version}/I3_VERSION | ||
''; | ||
|
||
# fatal error: GENERATED_config_enums.h: No such file or directory | ||
enableParallelBuilding = false; | ||
}) // { | ||
|
||
meta = with stdenv.lib; { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think meta works with overrideAttrs. Can you confirm that the meta is still being applied? I thought you still had to do a union like with overrideDerivation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does indeed work, the main reason I'm doing this PR is to have meta.position
available. All other meta attributes work as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok looks good then.
These four top-level packages were the only ones that didn't have the
meta.position attribute automagically set. This commit fixes this.
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)