summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-09-02 19:48:52 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-09-02 19:49:34 +0200
commitc090efb9d84b7be09c1109de7a39e6ac711d6b16 (patch)
tree8e08e6f2705c20d2ce32a4183cf08eae301ffb8f /nixos
parent190a49e0464444550dccf4fb7b136f95ed47afe1 (diff)
downloadnixlib-c090efb9d84b7be09c1109de7a39e6ac711d6b16.tar
nixlib-c090efb9d84b7be09c1109de7a39e6ac711d6b16.tar.gz
nixlib-c090efb9d84b7be09c1109de7a39e6ac711d6b16.tar.bz2
nixlib-c090efb9d84b7be09c1109de7a39e6ac711d6b16.tar.lz
nixlib-c090efb9d84b7be09c1109de7a39e6ac711d6b16.tar.xz
nixlib-c090efb9d84b7be09c1109de7a39e6ac711d6b16.tar.zst
nixlib-c090efb9d84b7be09c1109de7a39e6ac711d6b16.zip
command-not-found: Fix nix-env invocation
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/programs/command-not-found/command-not-found.nix4
-rw-r--r--nixos/modules/programs/command-not-found/command-not-found.pl6
2 files changed, 5 insertions, 5 deletions
diff --git a/nixos/modules/programs/command-not-found/command-not-found.nix b/nixos/modules/programs/command-not-found/command-not-found.nix
index bead2dcdcf90..9524d91ea3bc 100644
--- a/nixos/modules/programs/command-not-found/command-not-found.nix
+++ b/nixos/modules/programs/command-not-found/command-not-found.nix
@@ -57,9 +57,9 @@ in
           if [ $? = 126 ]; then
             "$@"
           fi
-	else
+        else
           # Indicate than there was an error so ZSH falls back to its default handler
-	  return 127
+          return 127
         fi
       }
     '';
diff --git a/nixos/modules/programs/command-not-found/command-not-found.pl b/nixos/modules/programs/command-not-found/command-not-found.pl
index 621b79d16543..b233d973a4ab 100644
--- a/nixos/modules/programs/command-not-found/command-not-found.pl
+++ b/nixos/modules/programs/command-not-found/command-not-found.pl
@@ -30,11 +30,11 @@ The program ‘$program’ is currently not installed. It is provided by
 the package ‘$package’, which I will now install for you.
 EOF
         ;
-        exit 126 if system("nix-env", "-iA", $package) == 0;
+        exit 126 if system("nix-env", "-iA", "nixos.$package") == 0;
     } else {
         print STDERR <<EOF;
 The program ‘$program’ is currently not installed. You can install it by typing:
-  nix-env -iA $package
+  nix-env -iA nixos.$package
 EOF
     }
 } else {
@@ -42,7 +42,7 @@ EOF
 The program ‘$program’ is currently not installed. It is provided by
 several packages. You can install it by typing one of the following:
 EOF
-    print STDERR "  nix-env -iA $_->{package}\n" foreach @$res;
+    print STDERR "  nix-env -iA nixos.$_->{package}\n" foreach @$res;
 }
 
 exit 127;