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

Feature Request: pay-respects #6204

Open
muItilingualism opened this issue Dec 13, 2024 · 7 comments
Open

Feature Request: pay-respects #6204

muItilingualism opened this issue Dec 13, 2024 · 7 comments
Assignees

Comments

@muItilingualism
Copy link

Description

pay-respects, a terminal command correction program, alternative to thefuck, written in Rust. Available as programs.pay-respects.

Hi, pay-respects was added in NixOS 24.11, and I'd like it to be in home-manager as well, since thefuck does not seem to be maintained.

Relevant links:

Thanks!

@Adda0
Copy link
Contributor

Adda0 commented Dec 22, 2024

We should also add an option to specify the suggestion rules, written in Nix and converted to TOML files which get inserted at the required location (~/.config/pay-respects/rules/<command_name>.toml), e.g.:

programs.pay-respects.rules = {
  cargo = {
    # Rule file `cargo.toml` for `cargo` command.
  };
  make = {
    # Rule file `make.toml` for `make` command.
  };
  # ...
}

@SimonYde
Copy link

SimonYde commented Dec 23, 2024

currently the module does not work for nushell, as there is the placeholder "[<alias>]" which should be an alias like the default "f".

@SimonYde
Copy link

Perhaps an HM option should be added to change the alias used

@jpteb
Copy link
Contributor

jpteb commented Jan 2, 2025

The config option for nushell fundamentally doesn’t work with nixos. This is because the pay-respects nushell command attempts to manually write its alias to the configuration file, which doesn't work, as it is read-only.

Additionally, I haven’t been able to get the command to work properly at all. I’ve tried various arguments with pay-respects nushell --alias ..., but none of them worked as expected. But this doesn't really matter, as my solution writes the command by itself.

I'll create a pr shortly, but the nushell integration is a bit scuffed, as it relies on internal code and breaks as soon as the nushell integration doesn't print the command in the first line anymore.

@ALameLlama
Copy link
Contributor

We should also add an option to specify the suggestion rules, written in Nix and converted to TOML files which get inserted at the required location (~/.config/pay-respects/rules/<command_name>.toml), e.g.:

programs.pay-respects.rules = {
  cargo = {
    # Rule file `cargo.toml` for `cargo` command.
  };
  make = {
    # Rule file `make.toml` for `make` command.
  };
  # ...
}

I'm not sure this will work since the rules must be recompiled and don't hot load them in.

@iffse
Copy link

iffse commented Jan 6, 2025

I'm not sure this will work since the rules must be recompiled and don't hot load them in.

@ALameLlama For versions >=0.6, runtime rules support is provided by runtime-rules module. For versions 0.5.x, rules can be read at runtime with runtime-rules feature. Older versions only support compile-time rules.

@ALameLlama
Copy link
Contributor

I'm not sure this will work since the rules must be recompiled and don't hot load them in.

@ALameLlama For versions >=0.6, runtime rules support is provided by runtime-rules module. For versions 0.5.x, rules can be read at runtime with runtime-rules feature. Older versions only support compile-time rules.

That's awesome, I hope people still end up upstreaming changes instead of keeping it to themselves

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

No branches or pull requests

9 participants