From cd11c02c286a996ff55010146baecae4c413634f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sun, 20 Jun 2021 20:40:37 +0200 Subject: [PATCH] command-not-found: update from nixpkgs --- .../command-not-found/command-not-found.nix | 7 +------ .../programs/command-not-found/command-not-found.pl | 13 +++++++------ 2 files changed, 8 insertions(+), 12 deletions(-) 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;