summary refs log tree commit diff
path: root/pkgs/shells/bash
diff options
context:
space:
mode:
authorNaïm Favier <n@monade.li>2023-01-01 10:43:13 +0100
committerGitHub <noreply@github.com>2023-01-01 10:43:13 +0100
commitd62198f2d4e68882f405e9e6dd6f4093feb6bffe (patch)
tree76954fbca5cab032af16fa8686d8dab88c56566d /pkgs/shells/bash
parent84b6c24b9b66d83c93ce9762a8b9d7b2be0aef0b (diff)
parentcd5d9f62066a93b4a0c8169c2fa9f092faf8248b (diff)
downloadnixpkgs-d62198f2d4e68882f405e9e6dd6f4093feb6bffe.tar
nixpkgs-d62198f2d4e68882f405e9e6dd6f4093feb6bffe.tar.gz
nixpkgs-d62198f2d4e68882f405e9e6dd6f4093feb6bffe.tar.bz2
nixpkgs-d62198f2d4e68882f405e9e6dd6f4093feb6bffe.tar.lz
nixpkgs-d62198f2d4e68882f405e9e6dd6f4093feb6bffe.tar.xz
nixpkgs-d62198f2d4e68882f405e9e6dd6f4093feb6bffe.tar.zst
nixpkgs-d62198f2d4e68882f405e9e6dd6f4093feb6bffe.zip
Merge pull request #207224 from ncfavier/nix-bash-completions
Diffstat (limited to 'pkgs/shells/bash')
-rw-r--r--pkgs/shells/bash/nix-bash-completions/default.nix11
1 files changed, 8 insertions, 3 deletions
diff --git a/pkgs/shells/bash/nix-bash-completions/default.nix b/pkgs/shells/bash/nix-bash-completions/default.nix
index c4282ab0f64..af516a1bcaa 100644
--- a/pkgs/shells/bash/nix-bash-completions/default.nix
+++ b/pkgs/shells/bash/nix-bash-completions/default.nix
@@ -11,8 +11,13 @@ stdenv.mkDerivation rec {
     sha256 = "1n5zs6xcnv4bv1hdaypmz7fv4j7dsr4a0ifah99iyj4p5j85i1bc";
   };
 
+  postPatch = ''
+    # Nix 2.4+ provides its own completion for the nix command, see https://github.com/hedning/nix-bash-completions/issues/20
+    substituteInPlace _nix --replace 'nix nixos-option' 'nixos-option'
+  '';
+
   strictDeps = true;
-  # To enable lazy loading via. bash-completion we need a symlink to the script
+  # To enable lazy loading via bash-completion we need a symlink to the script
   # from every command name.
   installPhase = ''
     runHook preInstall
@@ -36,8 +41,8 @@ stdenv.mkDerivation rec {
     description = "Bash completions for Nix, NixOS, and NixOps";
     license = licenses.bsd3;
     platforms = platforms.all;
-    maintainers = with maintainers; [ hedning ];
-    # Set a lower priority such that the newly provided completion from Nix 2.4 are preferred.
+    maintainers = with maintainers; [ hedning ncfavier ];
+    # Set a lower priority such that Nix wins in case of conflicts.
     priority = 10;
   };
 }