14
submitted 3 months ago by Trajan@monero.town to c/shell@programming.dev

I want to interactively query nix pkgs using the nix-search command provided by nix-search-cli

Not really experiaenced in cli tools any ideas to make this work ?

you are viewing a single comment's thread
view the rest of the comments
[-] addison@programming.dev 2 points 3 months ago

It looks like you haven't passed a package name to nix-search, so it's just printing the usage info, and fzf is ingesting the lines of that usage info for you to fuzzy search over.

fzf won't pass the search query back to whatever program piped in the input. The search query is only used to narrow the results.

I'm not sure how to go about interactively searching nixpkgs with fzf, but you could start by writing a function that accepts a package name or whatever you want to search for and passes it to nix-search. Then fzf can narrow down the results for you.

this post was submitted on 04 Aug 2024
14 points (93.8% liked)

Shell Scripting

3 readers
4 users here now

From Ash, Bash and Csh to Xonsh, Ysh and Zsh; all shell languages are welcome here!

Rules:
  1. Follow Lemmy rules!
  2. Posts must relate to shell scripting. (See bottom of sidebar for more information.)
  3. Only make helpful replies to questions. This is not the place for low effort joke answers.
  4. No discussion about piracy or hacking.
  5. If you find a solution to your problem by other means, please take your time to write down the steps you used to solve your problem in the original post. You can potentially help others having the same problem!
  6. These rules will change as the community grows.

Keep posts about shell scripting! Here are some guidelines to help:


In general, if your submission text is primarily shell code, then it is welcome here!

founded 1 year ago
MODERATORS