`inherit` with an expression

As part of a project I hope to unveil soon™ I’m writing a parser for Nix. I currently have most of the language, as far as I can tell, and I’m testing it on nixpkgs, where I found this:

# nixpkgs/pkgs/applications/video/vdr/plugins.nix:41 inherit (lib.genAttrs [ "epgtableid0" "hello" "osddemo" "pictures" "servicedemo" "status" "svdrpdemo" ] mkPlugin) ; 

And I’m confused. My reading of this is that it’s in the shape of

inherit (attrset) attr1 attr2 attr3; 

But with an empty list of attributes, and therefore a noop?

Or is the documentation missing a different way to use inherit?

1 Like

Your assessment is correct, this inherit does nothing. It appears to be a mistake made in 75060fab7625f which wasn’t noticed in code review. You can observe the attributes vdrPlugins.hello, vdrPlugins.osddemo etc. are all missing.

5 Likes

thank you, posted a comment in https://github.com/NixOS/nixpkgs/pull/59083

I’d suggest sending a PR, I think commenting on a 6 year old merged PR may not get attention.

@waffle8946 I would if I had any clue on what the code is trying to do. I don’t super feel like digging into something I… probably won’t ever use?

Then file an issue? I just don’t see a comment on a long merged PR (that will primarily be seen by people who might not even participate in nixpkgs anymore) as all that productive :person_shrugging:

Will do in the future. The ping on the old PR worked this time, but I think you’re right that a new issue would have made more sense :slight_smile: