GithubHelp home page GithubHelp logo

nix-community / comma Goto Github PK

View Code? Open in Web Editor NEW
966.0 966.0 46.0 93 KB

Comma runs software without installing it. [maintainers=@Artturin,@burke,@DavHau]

Nix 19.92% Rust 75.47% Shell 4.61%
nix nixos

comma's People

Contributors

aaschmid avatar arcuru avatar artturin avatar athre0z avatar badboy avatar burke avatar cyntheticfox avatar davhau avatar dependabot[bot] avatar diniamo avatar errornointernet avatar fzakaria avatar heinwol avatar janik-haag avatar lilyinstarlight avatar mic92 avatar numkem avatar sciencentistguy avatar sohalt avatar supersandro2000 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

comma's Issues

How to install this?

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

Run arbitrary flake?

For example,

, github:srid/emanote run -L ./docs

would translate to

nix run github:srid/emanote -- run -L ./docs

Use local `nixpkgs` instead of downloading it as soon as a new "version" is available

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!

No Longer Working - Only Shows `no match`

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!

Comma db age check runs on "modified" time

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?

.duration_since(modified)

aarch64-darwin is newly unsupported

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?

"attribute 'x11' missing"

โœ” >>  , --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.

`error: value is null while a set was expected` on update

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)

Nix-index database does not exist, try updating with `--update`.

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

Comma tries to use nix-channels with flakes

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)

Problem getting comma working with home-manager

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.

comma fails to run with fish

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>

"no match" on all invocations

(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) [~]  

Prebuilt index not found

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!

Feature request: new command `,man` for reading manual pages

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.

Print package name of executable

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 :)

Always depends on full nixpkgs checkout

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

Doesn't work with shells

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

Shell completion

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).

Cannot see which packages contain matching executable without running anything

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?

Comma tries to create a directory in /nix/store

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

Add --shell option

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.

Stop using $NIX_PATH and channels

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.

Add to Nixpkgs

Is there any way we could get this added to Nixpkgs? Doing so would greatly simplify the installation/setup/upgrade process.

Consider allowing local nix-index

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.

Future plans and ideas

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.

  1. I want to add the ability to add a bunch of packages at once in shell mode. Like , -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.
  2. Result caching. Calling nix-index each time you write , command takes a lot of time and therefore is annoying. Especially if you called command just 3 seconds ago

I also have some other vague thoughts but here are the main points of my interest.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.