Skip to content
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

feat: added plugin to launch nix applications without installing them #83

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Sntx626
Copy link

@Sntx626 Sntx626 commented Aug 16, 2023

This plugin creates a local cache of all available applications within nixpkgs and makes them available to be launched by anyrun.

Since most applications aren't downloaded to the /nix/store when you first launch them, expect to wait a few seconds for nix to prepare them in the background.
They should start instantly after the first launch.

sntx added 4 commits August 16, 2023 20:29
Flake lock file updates:

• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/71fb97f0d875fd4de4994dfb849f2c75e17eb6c3' (2023-06-01)
  → 'github:hercules-ci/flake-parts/59cf3f1447cfc75087e7273b04b31e689a8599fb' (2023-08-01)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/e635192892f5abbc2289eaac3a73cdb249abaefd' (2023-06-01)
  → 'github:NixOS/nixpkgs/caac0eb6bdcad0b32cb2522e03e4002c8975c62e' (2023-08-16)
@fufexan
Copy link
Contributor

fufexan commented Aug 16, 2023

I think nix-run is a better name for the plugin, since that's the command being run in the background.

@Sntx626
Copy link
Author

Sntx626 commented Aug 16, 2023

Yes, nix-run is more descriptive. I'll update the pr.

Copy link
Author

@Sntx626 Sntx626 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All should be updated to nix-run

@Sntx626 Sntx626 changed the title [Plugin] Nix feat: added plugin to launch nix applications without installing them Aug 16, 2023
README.md Outdated Show resolved Hide resolved
@fufexan
Copy link
Contributor

fufexan commented Aug 16, 2023

Without an activation keyword, doesn't this plugin "conflict" with the applications plugin? Basically you'd get the same programs twice in case you already have the program installed.

Co-authored-by: Mihai Fufezan <[email protected]>
@Sntx626
Copy link
Author

Sntx626 commented Aug 16, 2023

Without an activation keyword, doesn't this plugin "conflict" with the applications plugin? Basically you'd get the same programs twice in case you already have the program installed.

I'd say it depends.

Yes, it might show redundant applications.
But the list of applications (and their descriptions) might outweigh the doubled entry.
Furthermore it allows the user to launch the same application twice with different versions (since nix-run doesn't need to follow the nix installed apps).

In the long run it would be smarter to add a prefix as a configuration option.
I'll probably add it tomorrow.

@fufexan
Copy link
Contributor

fufexan commented Aug 16, 2023

What about nixpkgs#? That way it's explicitly clear what's going on.

@Sntx626
Copy link
Author

Sntx626 commented Aug 16, 2023

I though about adding it as a config option similar to how symbols does it.

nixpkgs# would be a good default value (though I personally prefer for it to be the empty prefix, yet again: it wouldn't hurt to implement nixpkgs# as the default and overwrite it in my system config).

Copy link
Author

@Sntx626 Sntx626 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, did it today, implementing a command prefix was trivial with the code provided by the symbols plugin.

@TheRealGramdalf
Copy link
Contributor

TheRealGramdalf commented Apr 17, 2024

This seems very similar to , - since it's also written in rust, would it be possible to integrate such that you don't need to necessarily know the exact package name if it has a different executable (e.g. nix run nixpkgs#gsettings doesn't work, since it's provided by nixpkgs#glib instead)?

This could also be of use for the prefix, as you could simply set it to , by default (the same as comma's CLI)

@Sntx626
Copy link
Author

Sntx626 commented Apr 17, 2024

This seems very similar to , - since it's also written in rust, would it be possible to integrate such that you don't need to necessarily know the exact package name if it has a different executable (e.g. nix run nixpkgs#gsettings doesn't work, since it's provided by nixpkgs#glib instead)?

The would be possible, but the index building would need to be redone. Mostly because some outputs are present multiple times, i.e. ls from coreutils, coreutils-full and uutils-coreutils.

We could also look into dynamically fetching the outputs as an optional feature. This could also be extended to work with flakes. I.e. nix-run anyrun-org/anyrun would add all packages/apps outputs defined in the flake to the fuzzy search.

This could also be of use for the prefix, as you could simply set it to , by default (the same as comma's CLI)

This could easilty be done by changing the prefix in the config.
While , as a tool exists, I think that it's better to keep something more descriptive as the default.


Though atm my priority to implement this addition is relatively low.

This can still be merged, once we know for certain on how anyrun-org wants to manage non-core plugins.
The current conflicts (*.lock files) can be just overridden from main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants