nix-bash-completions
nix-bash-completions copied to clipboard
Support Nix 2.4
so far only tested it with basic commands but it works better then before where the current line was cleared.
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?
I did that in an overlay where I combined the old and new one.
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
'';
});
}
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": https://github.com/hedning/nix-bash-completions/pull/21