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

Support Nix 2.4 #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

SuperSandro2000
Copy link

@SuperSandro2000 SuperSandro2000 commented May 18, 2021

so far only tested it with basic commands but it works better then before where the current line was cleared.

@ncfavier
Copy link

Nix 2.4 has its own completion script which collides with nix-bash-completions.

Maybe it would be better to remove completion for the nix command altogether when the Nix version is at least 2.4?

@SuperSandro2000
Copy link
Author

I did that in an overlay where I combined the old and new one.

@SuperSandro2000
Copy link
Author

final: prev: {
  nix-bash-completions = prev.nix-bash-completions.overrideAttrs (oldAttrs: {
    patches = [
      # nom-build
      (final.fetchpatch {
        url = "https://github.com/hedning/nix-bash-completions/commit/2861e9b1b7351b77852444a79d164469ebbedd52.patch";
        sha256 = "sha256-L3NhFbnKwqP8+DaqG2/cufjQU7fuNhmXNMaC9m0YDEg=";
      })
      # nix 2.4 support
      (final.fetchpatch {
        url = "https://github.com/hedning/nix-bash-completions/commit/5d28f3de9244ccf679630770b90448a22a65aced.patch";
        sha256 = "sha256-Kez20a8YMvUe8lDVmzDCC8OmNX3taUMtjy917whlPUU=";
      })
    ];

    postPatch = ''
      substituteInPlace _nix \
        --replace "nix nixos-option" "nixos-option"

      cat ${prev.nixUnstable}/share/bash-completion/completions/nix >> _nix
    '';
  });
}

@bjornfor
Copy link

so far only tested it with basic commands but it works better then before where the current line was cleared.

Here's another PR that fixes "TAB completion erases line": #21

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