-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Fish completions fail for missing attribute 'name' #2813
Comments
Hi, The assumption in Home Manager's logic is that the Using the primitive I don't think there's anything to fix on our side though I might be wrong. If you think so, a PR is welcome! |
As I have described in the issue, this assumption does not hold. Sometimes there's only I would prepare a PR if I knew this affected only the fish completions. But if this is a general assumption that does not hold which spreads throughout the codebase I'm not sure a PR to change it at this place would justify the inconsistencies. So I guess, I'll leave it at this status quo. |
FWIW there is a function getName in Nixpkgs. See https://github.com/NixOS/nixpkgs/blob/7d6954d8dfd68f47b5c8fe803a47959a3423c4ab/lib/strings.nix#L614-L629 |
I just noticed the following issue in nixpkgs: NixOS/nixpkgs#103997 |
Thank you for linking that. I just noticed I did not link it in the original issue because I thought it was a well-known plan (after all, it has been communicated for nearly two years now). This long-term effort is also the reason why I mentioned that berbiche's statement
obviously shows that General disclaimer: I haven't even checked whether the |
I think it wouldn't be controversial to create a PR that changes the module to use Nixpkgs' I'll reopen this issue for now. |
Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting. If you are the original author of the issue
If you are not the original author of the issue
Memorandum on closing issuesDon't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort. |
Query the `pname` and `version` attributes for completion generation, if the `name` attribute is not available. Fixes nix-community#2813
Query the `pname` and `version` attributes for completion generation, if the `name` attribute is not available. Fixes nix-community#2813
Query the `pname` and `version` attributes for completion generation, if the `name` attribute is not available. Fixes nix-community#2813
Query the `pname` and `version` attributes for completion generation, if the `name` attribute is not available. Fixes nix-community#2813
After a recent update of my nixpkgs (unstable channel), home-manager will not rebuild anymore if I enable fish. Error message as follows:
My suspicion is that the code at
home-manager/modules/programs/fish.nix
Lines 307 to 313 in 835797f
relies too much on the
name
attribute which often is replaced bypname
andversion
, as seems to be the case in nixpkgs' definition for fish. I have seen that thestdenv
checker does use agetName
function to retrieve the package name (see here) but that might be overkill since seemingly only the module here is affected.I'm not entirely sure (and can't test at the moment) but maybe using
pkgs.runCommand "${package.pname}-${package.version}-fish-completions"
instead of the currentpackage.name
would already be enough?Edit: Actually, it seems that not all packages have
pname
either, so I just tried running with the following snippetand it at least solved my issue. I don't know whether this is a good place to insert such a
getName
function (taken from the source linked above) or whether it should be imported somehow, hence I won't prepare a PR.The text was updated successfully, but these errors were encountered: