summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-06-04 14:18:18 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-06-04 14:18:18 +0200
commitbbfc47326b393daf26c7227bfa2cfc235e812251 (patch)
treeb0e7f9245a0c2774e25d771ac22b78f578e134a1
parent3327b9a385f5ec2e219bf93b48896772b3f66afc (diff)
downloadnixpkgs-bbfc47326b393daf26c7227bfa2cfc235e812251.tar
nixpkgs-bbfc47326b393daf26c7227bfa2cfc235e812251.tar.gz
nixpkgs-bbfc47326b393daf26c7227bfa2cfc235e812251.tar.bz2
nixpkgs-bbfc47326b393daf26c7227bfa2cfc235e812251.tar.lz
nixpkgs-bbfc47326b393daf26c7227bfa2cfc235e812251.tar.xz
nixpkgs-bbfc47326b393daf26c7227bfa2cfc235e812251.tar.zst
nixpkgs-bbfc47326b393daf26c7227bfa2cfc235e812251.zip
Don't enable nix-bash-completions when using Nix 2.4
2.4 has its own completion script which collides with
nix-bash-completions.
-rw-r--r--nixos/modules/config/system-path.nix4
-rw-r--r--nixos/modules/programs/bash/bash.nix3
-rw-r--r--nixos/modules/services/misc/nix-daemon.nix6
3 files changed, 7 insertions, 6 deletions
diff --git a/nixos/modules/config/system-path.nix b/nixos/modules/config/system-path.nix
index 4100ec89701..cba357171d7 100644
--- a/nixos/modules/config/system-path.nix
+++ b/nixos/modules/config/system-path.nix
@@ -8,8 +8,7 @@ with lib;
 let
 
   requiredPackages = map (pkg: setPrio ((pkg.meta.priority or 5) + 3) pkg)
-    [ config.nix.package
-      pkgs.acl
+    [ pkgs.acl
       pkgs.attr
       pkgs.bashInteractive # bash with ncurses support
       pkgs.bzip2
@@ -33,7 +32,6 @@ let
       pkgs.nano
       pkgs.ncurses
       pkgs.netcat
-      pkgs.nix-info
       config.programs.ssh.package
       pkgs.perl
       pkgs.procps
diff --git a/nixos/modules/programs/bash/bash.nix b/nixos/modules/programs/bash/bash.nix
index be964ce7f3f..1b3254b54a5 100644
--- a/nixos/modules/programs/bash/bash.nix
+++ b/nixos/modules/programs/bash/bash.nix
@@ -238,9 +238,6 @@ in
       "/share/bash-completion"
     ];
 
-    environment.systemPackages = optional cfg.enableCompletion
-      pkgs.nix-bash-completions;
-
     environment.shells =
       [ "/run/current-system/sw/bin/bash"
         "/run/current-system/sw/bin/sh"
diff --git a/nixos/modules/services/misc/nix-daemon.nix b/nixos/modules/services/misc/nix-daemon.nix
index 2577cb78e96..0b3d7f3f03c 100644
--- a/nixos/modules/services/misc/nix-daemon.nix
+++ b/nixos/modules/services/misc/nix-daemon.nix
@@ -442,6 +442,12 @@ in
     nix.binaryCachePublicKeys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" ];
     nix.binaryCaches = [ "https://cache.nixos.org/" ];
 
+    environment.systemPackages =
+      [ nix
+        pkgs.nix-info
+      ]
+      ++ optional (config.programs.bash.enableCompletion && !versionAtLeast nixVersion "2.4pre") pkgs.nix-bash-completions;
+
     environment.etc."nix/nix.conf".source = nixConf;
 
     environment.etc."nix/registry.json".text = builtins.toJSON {