diff --git a/modules/programs/command-not-found/command-not-found.nix b/modules/programs/command-not-found/command-not-found.nix index b79fde0f..a4917bbf 100644 --- a/modules/programs/command-not-found/command-not-found.nix +++ b/modules/programs/command-not-found/command-not-found.nix @@ -11,13 +11,8 @@ let dir = "bin"; src = ./command-not-found.pl; isExecutable = true; - inherit (pkgs) perl; inherit (cfg) dbPath; - perlFlags = concatStrings (map (path: "-I ${path}/lib/perl5/site_perl ") [ - pkgs.perlPackages.DBI - pkgs.perlPackages.DBDSQLite - pkgs.perlPackages.StringShellQuote - ]); + perl = pkgs.perl.withPackages (p: [ p.DBDSQLite p.StringShellQuote ]); }; shInit = commandNotFoundHandlerName: '' diff --git a/modules/programs/command-not-found/command-not-found.pl b/modules/programs/command-not-found/command-not-found.pl index 997dfec6..220d057b 100644 --- a/modules/programs/command-not-found/command-not-found.pl +++ b/modules/programs/command-not-found/command-not-found.pl @@ -1,4 +1,4 @@ -#! @perl@/bin/perl -w @perlFlags@ +#! @perl@/bin/perl -w use strict; use DBI; @@ -29,16 +29,17 @@ if (!defined $res || scalar @$res == 0) { exec("nix-shell", "-p", $package, "--run", shell_quote("exec", @ARGV)); } else { print STDERR <{package}\n" foreach @$res; + print STDERR " nix-shell -p $_->{package}\n" foreach @$res; } exit 127;