nix-community / comma

Comma runs software without installing it. [maintainers=@Artturin,@burke,@DavHau]
1.09k stars 48 forks source link

Problem getting comma working with home-manager #48

Closed kevin-stuart closed 1 year ago

kevin-stuart commented 1 year ago

I installed comma with home-manager. Then I tried this

, fish
# Warning: Nix-index database does not exist, try updating with `--update`.
# nix-locate failed with: error: reading from the database at '/home/$USER/.cache/nix-index/files' failed.
# This may be caused by a corrupt or missing database, try (re)running `nix-index` to generate the database.
# If the error persists please file a bug report at https://github.com/bennofs/nix-index.
# caused by: No such file or directory (os error 2)

OK, I then tried

comma --update
# Updating nix-index database, takes around 5 minutes.
# + querying available packages
# error: querying available packages failed
# caused by: nix-env failed with error: nix-env failed with unknown exit code:

OK, I then tried it without home-manager by just trying comma with nix-shell -p comma, but the results were identical.

Artturin commented 1 year ago

The error is from nix-index

kevin-stuart commented 1 year ago

So should it be reporteed in nix-index issues? I saw you comment in https://github.com/bennofs/nix-index/issues/195 as well, would it make sense that you open an issue there for this?

Since context is important, wouldn't it be possible that there one could say "problem could be from how comma is using nix-index" and refert to take it up with comma issues instead?

Artturin commented 1 year ago

deprecated the --update flag https://github.com/nix-community/comma/commit/7aeaea325c16592e17f1f913fa11f5998e0ac422

run nix-index with --show-trace and it'll output more information

kevin-stuart commented 1 year ago

It did not return anything???

[nix-shell:~]$ nix-index --show-trace
+ querying available packages
error: querying available packages failed
caused by: nix-env failed with error: nix-env failed with unknown exit code:
kevin-stuart commented 1 year ago

I just realized that this was just closed without any way for me to know what to do if I want to use comma. The deprecation does not help at all, I already understood from the message was from nix-index. I also ran nix-index with --show-trace just as you asked, but the return did not give any new info, there was not even an exit code. I asked you if we should take this to nix-index to resole this. I'm a little lost about what to do next.

Artturin commented 1 year ago

maybe caused by misconfigured channels or smth, you can report it in nix-index if you want

you can use the prebuilt index then you wont have to worry about it

mkdir -p "$HOME/.cache/nix-index" && wget https://github.com/Mic92/nix-index-database/releases/latest/download/index-x86_64-linux -O "$HOME/.cache/nix-index/files"
kevin-stuart commented 1 year ago

Well that worked. Thank you. It would be nice if nix-index -u worked, but oh well.

BTW, as for channels, I only have this

nix-channel --list
home-manager https://github.com/nix-community/home-manager/archive/master.tar.gz
nixpkgs https://nixos.org/channels/nixpkgs-unstable

Fairly fresh install with not very much else. Comma was installed in home-maanger. Is that a problem?