From 8e92630aae97864975761be92976ac0801954f3f Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Fri, 26 Nov 2021 02:16:08 -0500 Subject: [PATCH 1/2] nixos: Provide nix-bash-completions again for stable commands --- nixos/modules/services/misc/nix-daemon.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/misc/nix-daemon.nix b/nixos/modules/services/misc/nix-daemon.nix index 4ea45888e5fc..a3e0f3e0d120 100644 --- a/nixos/modules/services/misc/nix-daemon.nix +++ b/nixos/modules/services/misc/nix-daemon.nix @@ -546,7 +546,7 @@ in [ nix pkgs.nix-info ] - ++ optional (config.programs.bash.enableCompletion && !versionAtLeast nixVersion "2.4pre") pkgs.nix-bash-completions; + ++ optional (config.programs.bash.enableCompletion) pkgs.nix-bash-completions; environment.etc."nix/nix.conf".source = nixConf; From 8608d393e87a33d8ebc95f76f4c5fa03467d096e Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Fri, 26 Nov 2021 02:17:15 -0500 Subject: [PATCH 2/2] nix-bash-completions: Reduce priority for Nix 2.4 Reducing the priority makes the system build prefer the Nix-provided completions, for e.g. the new `nix` commands. --- pkgs/shells/bash/nix-bash-completions/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/shells/bash/nix-bash-completions/default.nix b/pkgs/shells/bash/nix-bash-completions/default.nix index 2034eed1f5da..2e8b49385fb4 100644 --- a/pkgs/shells/bash/nix-bash-completions/default.nix +++ b/pkgs/shells/bash/nix-bash-completions/default.nix @@ -32,5 +32,7 @@ stdenv.mkDerivation rec { 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. + priority = 10; }; }