nix-community / comma Goto Github PK
View Code? Open in Web Editor NEWComma runs software without installing it. [maintainers=@Artturin,@burke,@DavHau]
Comma runs software without installing it. [maintainers=@Artturin,@burke,@DavHau]
Hi
I'm new to nix, it would be nice to have a oneliner on how to install this nix package for newcomers like me ๐ I already have nix installed
EDIT: I figured out you can install it using nix-env -i -f https://github.com/Shopify/comma/tarball/master
For example,
, github:srid/emanote run -L ./docs
would translate to
nix run github:srid/emanote -- run -L ./docs
As far as I could analyze the used nix shell
if nix
v2.4 or above downloads nixpkgs
once a new "version" is available. I am unsure why this is the case.
I have not found a proper solution staying with nix shell
however could think about a fix using nix-shell
like here. Even though this does not allow me specifying $NIXPKGS
. Was this only introduced for flakes and therefore only relevant there?
Is the reason for this default behavior of nix
(at least I interpret it like that) because of compatibility with binary caches? Are is there any other reason which I haven't found in documentation?
I think this could be a worthwhile improvement because local nixpkgs
might be sufficient to run any new scripts and it saves a lot of time as updates to nixpkgs
are not very rare ;-)
Any opinion welcome!
There is nix-profile
install guide with flakes, but no configuration install guide with flakes.
Please add it.
Thanks
I installed comma in my home-manager config and it's been working well for a while, and has been awesome!
However recently all it tells me is no match
, even when I execute , cowsay neato
As this is using the pre-built nix-index-database, I'm not sure how to attempt to update the index, or even if that'd help.
Version: 1.2.3 (from the unstable channel)
OS: NixOS 21.11
Arch: x86_64
Any help would be greatly appreciated!
Found this when going to run comma, and getting
Warning: Nix-index database is older than 30 days, try updating with `--update`.
Though my database is definitely up-to-date. I'm using a pre-packaged db, so it stays up-to-date. From what I can tell, Nix sets file modification times in /nix/store
to 1
.
Perhaps ctime
(using stat
terms since the std::fs::metadata function returns based on that)/inode-update time would be a better metric for store age?
Line 34 in c83ff38
hey folks! I've been using comma for a while and it just stopped working on my aarch64-darwin machine. It was working as of 54149dc, so I guess some change newer than that intentionally broke it (I see x86_64-darwin
only now.)
Is there any way you could restore support for M1 Macs?
โ >> , --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 exit code 1:
error: attribute 'x11' missing
at /nix/store/5nk5q08yq9900gfwwq3aphsj6ya7m16h-nixos-21.11.335665.0f316e4d72d/nixos/pkgs/development/r-modules/default.nix:314:16:
313| HiCseg = [ pkgs.gsl ];
314| imager = [ pkgs.x11 ];
| ^
315| iBMQ = [ pkgs.gsl ];
Did you mean one of c14, e16, x2x, xa or xar?
(use '--show-trace' to show detailed location information)
~ 15s
I can't update the package index's because of this error. https://github.com/Krutonium/NewNix This is my config.
I have absolutely no idea why this is breaking. Tell me what you need to help you fix this.
I updated comma to the latest master
branch, followed by running comma --updated
(because it asked me to), which lead to:
โฏ 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 exit code 1:
error: value is null while a set was expected
at /nix/store/x3b24m65sn4r8ciyza1cbwr431320aal-nixpkgs/nixpkgs/pkgs/development/r-modules/default.nix:514:19:
513| pbdZMQ = lib.optionals stdenv.isDarwin [ pkgs.darwin.binutils ];
514| bigmemory = [ pkgs.libuuid.dev ];
| ^
515| clustermq = [ pkgs.pkg-config ];
(use '--show-trace' to show detailed location information)
After using the nix-env command to get comma, on the first run I get:
[tbe@nixos:~/src/k]$ , nix-index
Warning: Nix-index database does not exist, try updating with `--update`.
nix-locate failed with: error: reading from the database at '/home/tbe/.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)
But these instructions don't make sense without me manually installing nix-index
:
[tbe@nixos:~/src/k]$ nix-index
nix-index: command not found
I installed comma with:
$ nix profile install github:nix-community/comma
When running: , cbonsai
I get:
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels/nixos' does not exist, ignoring
error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I)
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.
I installed comma using flakes on NixOS unstable, I use fish as shell and comma fails to run on this shell, works fine with bash.
solene@t470 ~/data (master)> env RUST_BACKTRACE=full , musikcube
thread 'main' panicked at 'failed to execute nix-locate: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/main.rs:84:10
stack backtrace:
0: 0x55a363e6423b - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h04e1659590c75b7f
1: 0x55a363e75c0c - core::fmt::write::h934b5967ac569ed6
2: 0x55a363e53b55 - std::io::Write::write_fmt::h5ab422a8ac80f319
3: 0x55a363e5b731 - std::panicking::default_hook::{{closure}}::h494c7f9d4414967f
4: 0x55a363e5b331 - std::panicking::default_hook::h48ddca4adf4aa3dc
5: 0x55a363e5bc81 - std::panicking::rust_panic_with_hook::h003457efeb6d6b49
6: 0x55a363e64a20 - std::panicking::begin_panic_handler::{{closure}}::h251c8136df2fab02
7: 0x55a363e64354 - std::sys_common::backtrace::__rust_end_short_backtrace::h27a470ecec345006
8: 0x55a363e5b812 - rust_begin_unwind
9: 0x55a363de5991 - core::panicking::panic_fmt::h4fce74342b1c33c5
10: 0x55a363de5a23 - core::result::unwrap_failed::h8c4993f73e62bc49
11: 0x55a363deea11 - comma::main::h3752c99db5ba6d3b
12: 0x55a363de9d73 - std::sys_common::backtrace::__rust_begin_short_backtrace::h235a2b433be5629b
13: 0x55a363de9d69 - std::rt::lang_start::{{closure}}::ha1f875eedb56f2d6
14: 0x55a363e51991 - std::rt::lang_start_internal::hca69a4afefa7c403
15: 0x55a363def3d2 - main
16: 0x7f6e005821d7 - __libc_start_call_main
17: 0x7f6e00582297 - __libc_start_main_impl
18: 0x55a363de5c81 - _start
19: 0x0 - <unknown>
(09:02:06) [~] , sl
no match
(09:02:18) [~] , --help
comma 1.2.3
runs programs without installing them
USAGE:
, [OPTIONS] <cmd>...
ARGS:
<cmd>... command to run
OPTIONS:
-h, --help Print help information
-i, --install install the derivation containing the executable
--picker <picker> [env: COMMA_PICKER=] [default: fzy]
-V, --version Print version information
(09:02:26) [~]
I tried to setup comma together with the prebuilt index from
https://github.com/Mic92/nix-index-database
but I get Warning: Nix-index database does not exist
.
I am on macOS and I have
nix-index-database.hmModules.nix-index
as a home-manager module,
further I have programs.nix-index.enable = true;
and finally I have comma
in home.packages
.
You can see the precise setup here:
Thanks!
So, e.g.
,man direnv
would allow me to read direnv
's manual with in a very similar manner as how ,
allows me to run it.
Use case: I often like to read manual pages as I consider using packages. This feature would allow me to do so in a faster and more convenient manner.
Hi,
would it be possible to add a flag like --package
that causes comma to print the package name (plus maybe other information) instead of executing the program.
This would be useful when you know the name of the executable, but the nix package is named differently. For example, the neovim binary is called nvim
. Let's say I do not know that the project/package is actually called neovim. Now, I could only use comma to run neovim (, nvim
) but I would have a hard time to install neovim. With a --package
flag I could find out that the package is actually called neovim.
Thanks :)
Since flake support comma now always depends on the full nixpkgs source which needs to be copied to remote builders when building it. This is really unnecessary when you handle nix-index standalone. How can I avoid this? Is there an easy way to get an option into the flake to build it without any updater support?
Because of pkgs.path my home-manager generation is now about 1GB bigger than before.
$ nix store diff-closures /nix/var/nix/profiles/per-user/hotpi/home-manager-5-link /nix/var/nix/profiles/per-user/hotpi/home-manager-6-link/
nixpkgs: โ
โ ฮต, +1099148.6 KiB
source: -49.9 KiB
This package doesn't work on shells like eshell
and shell
in emacs. And it probably doesn't work on any other shells either. This is probably due to the prompt that pops up when you have to choose which package to get the requested command from. It sort of works in emacs shell
but I can't actually make a choice
It would be nice if comma
shipped with shell completion files (i.e: make it so that the shell completes as if ,
was not there).
I frequently check which packages include an executable but I don't want to run the command. Comma shows me what packages contain the executable with fzy
in the selector but then I have to send a SIGINT to exit. If there's only package, the command will just run. --print-package
only prints the package containing the one chosen executable and runs the command afterward.
What if there was another flag like --list-packages
that printed off each package containing the executable and exited immediately after?
Hi,
I'm running comma from nixos-23.05 and I get this error:
NIX_PATH= , distrobox
error: creating directory '/nix/store/849qs729ij1x7vg454851frzyb0riz5c-comma-with-db-1.6.0/share/cache/nix': Read-only file system
sometimes I want to really fast open a shell with some binary. It would be cool if comma would accept --shell/-s which opens a nix-shell/nix shell with the package instead of running it.
When using Nix only with flakes you don't need nix channels.
It would be nice if comma would work without them too!
> , hello
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels/nixos' does not exist, ignoring
error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I)
P.S. I'm probably not going to use comma anymore, so feel free to close this issue, if you're not interested or if it's not feasible.
I am currently trying to use XDG_CACHE_DIR but this also affects other application that try to write to a read-only directory: nix-community/nix-index-database#48
Is there any way we could get this added to Nixpkgs? Doing so would greatly simplify the installation/setup/upgrade process.
First off thank you for comma; it's a great example of how to leverage multiple tools within the Nix ecosystem & demonstrate a simpler nix run
.
Your nix-index that you pre-package (which makes installing this super easy) is somewhat out of date.
A simple solution would be to allow searching for the default nix-index that someone may have run themselves.
Would be good to have an option to disable the picker to use an exact match instead
There isn't a discussions page here, so I'm opening an issue.
I would like to ask the maintainers about how do they see the future of the project. What's going to be done and what does definitely not line up with the idea of comma. Or is it more or less in finished state and you just want to maintain it (as it is now)?
I ask that because I have some ideas, but I'm not sure if they fit in here.
, -s package1 package2 package3
. Yes, it looks a lot like nix-shell -p ...
, but, if I guess correctly, it can also get packages by specifying a command name and not the package name. Secondly, it can use other inputs along with nixpkgs as long as they're indexed. And most importantly (for me) it drops you back to the shell you were in and not into bash., command
takes a lot of time and therefore is annoying. Especially if you called command
just 3 seconds agoI also have some other vague thoughts but here are the main points of my interest.
$ , code
No executable `code` found in nix-index database.
I'm not sure why :/. /bin/code
exists in vscode
package.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.