From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Nicol=C3=B2?= Balzarotti Subject: Re: Package file indexing Date: Wed, 15 Jan 2020 18:27:15 +0100 Message-ID: <87o8v44olo.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me> References: <20190314204941.GA21065@jasmine.lan> <87mulx9kuv.fsf@nckx> <87zhpx846u.fsf@ambrevar.xyz> <87bm21y2s2.fsf_-_@gnu.org> <87wo9shenq.fsf@ambrevar.xyz> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:45135) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irmRs-0002uN-QG for guix-devel@gnu.org; Wed, 15 Jan 2020 12:27:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1irmRr-0005Lc-HW for guix-devel@gnu.org; Wed, 15 Jan 2020 12:27:20 -0500 In-Reply-To: <87wo9shenq.fsf@ambrevar.xyz> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane-mx.org@gnu.org Sender: "Guix-devel" To: Pierre Neidhardt , Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: Guix-devel Hi Pierre, on NixOS, if you try to run the name of a program that you don't have installed (eg: $ endlessh) you get: The program =E2=80=98endlessh=E2=80=99 is currently not installed. You can = install it by typing: nix-env -iA nixos.endlessh program-not-found is a perl script that uses an sqlite file placed under: /nix/var/nix/profiles/per-user/root/channels/nixos/programs.sqlite I don't know how this database is created. Table structure: CREATE TABLE Programs ( name text not null, system text not null, package text not null, primary key (name, system, package) ); like kbdinfo|i686-linux|kbd (a nice thing I just found reading it: if you set NIX_AUTO_INSTALL=3D1 it automatically spawns a nix-shell with the required package and starts the program) Nicol=C3=B2 Pierre Neidhardt writes: > Ludovic Court=C3=A8s writes: > >> You should look at how NixOS does it for its =E2=80=98command-not-found= =E2=80=99 support >> (I think it=E2=80=99s part of NixOS, not Nix). IIRC they distribute an = SQLite >> database, but it=E2=80=99s a pretty ad-hoc mechanism without authenticat= ion. > > I haven't found this yet, but I found this instead: > > https://github.com/bennofs/nix-index/pulls > > Tobias, are you sure Nix has such a feature? > > --=20 > Pierre Neidhardt > https://ambrevar.xyz/