Skip to content
This repository was archived by the owner on Jul 8, 2026. It is now read-only.
This repository was archived by the owner on Jul 8, 2026. It is now read-only.

Revive command-not-found support #4

Closed

Description

@edolstra

We no longer generate programs.sqlite because that would require downloading all packages from cache.nixos.org. Need a solution. E.g. Hydra could upload a content listing of every NAR to the cache, which generate-programs-index.pl could download (with some local caching).

Activity

  1. self-assigned this
    on Mar 1, 2016
  2. domenkozar commented on Mar 2, 2016

    @domenkozar
    Member

    I'm thinking how command-not-found could also work for custom hydra installations. Maybe we could use multiple outputs to generate a list of installed files and command-not-found would depend on that output for all pkgs?

  3. domenkozar commented on Mar 2, 2016

    @domenkozar
    Member

    It would need to be pluggable, so maybe that's not ideal as it would have a different hash on hydra vs normal installation that wouldn't generate the lists.

  4. vcunat commented on Mar 17, 2016

    @vcunat
    Member

    It would be nice if the hook worked in 16.03, but we should at least put it into release notes if it won't. (funnily enough, we have an item in there improving the hook :)

  5. vcunat commented on Mar 17, 2016

    @vcunat
    Member

    I hoped the file list in a NAR would be decodable from a very short prefix of the NAR, but that seems not to be the case.

    As you suggest, it currently seems easiest to:

    • Create *.narlist next to *.narinfo when uploading to the cache; perhaps it might include listing of all files, as the extra size should be bearable at this point. (And we might compress this file; it should compress well.)
    • After all is finished and release should happen, download all .narlist and generate file database(s) (at least the one for bin/).
    • Optionally, add a web service querying those databases.
  6. layus commented on Mar 28, 2016

    @layus
    Member

    While we are designing a new system, it may be a nice bonus to make it general enough to support other use cases.
    I am thinking in particular to LaTeX wrappers able to download the right packages for a given document. That would be very useful for per-document nix-shell environments now that we have a fully modular tex distribution.

  7. vcunat commented on Mar 28, 2016

    @vcunat
    Member

    In case of TeX the situation is easier due to upstream providing listings of all package contents. ftp://tug.ctan.org/pub/tex/historic/systems/texlive/2015/tlnet-final/tlpkg/texlive.tlpdb.xz

  8. aloiscochard commented on May 19, 2016

    @aloiscochard

    Is there a workaround for this, so it could fail temporarily silently?

    The error is very verbose when using fish.

  9. domenkozar commented on May 19, 2016

    @domenkozar
    Member

    I've disabled it for now: NixOS/nixpkgs@2a3c0ca

  10. chris-martin commented on May 19, 2016

    @chris-martin

    Thanks, it was getting embarrassing while I'm trying to show nix off 😄

  11. FRidh commented on May 20, 2016

    @FRidh
    Member

    While we are designing a new system, it may be a nice bonus to make it general enough to support other use cases.

    There was also talk of some kind of dependency solver for precompiled binaries. That could also benefit from such database.

  12. chris-martin commented on May 20, 2016

    @chris-martin

    Would it be absurd to suggest explicitly passing a list of expected bin/ outputs to mkDerivation? It might be nice to have that anyway so the build process can do a sanity check to verify that bin contains the right things.

  13. 2 remaining items

  14. bjornfor commented on Jul 18, 2016

    @bjornfor

    My current workaround: use a Ubuntu VM to figure out command -> package-name mapping... Should I laugh or cry? :-)

  15. Myrl commented on Jul 24, 2016

    @Myrl

    @bjornfor I have an outdated VPS just for this.

  16. copumpkin commented on Aug 10, 2016

    @copumpkin
    Member
  17. domenkozar commented on Aug 11, 2016

    @domenkozar
    Member

    Thanks!!

  18. puffnfresh commented on Aug 11, 2016

    @puffnfresh
    Member

    🎆

  19. bjornfor commented on Aug 22, 2016

    @bjornfor

    Yay! Thank you, @edolstra!

  20. canndrew commented on Oct 14, 2016

    @canndrew

    So... how do I get this working? If I run command-not-found I get:

    DBI connect('dbname=/nix/var/nix/profiles/per-user/root/channels/nixos/programs.sqlite','',...) failed: unable to open database file at /run/current-system/sw/bin/command-not-found line 13.
    cannot open database `/nix/var/nix/profiles/per-user/root/channels/nixos/programs.sqlite' at /run/current-system/sw/bin/command-not-found line 13.
    

    Is there a way to fix it on an existing NixOS install?

  21. vcunat commented on Oct 14, 2016

    @vcunat
    Member

    @canndrew: apparently your channel isn't new enough; try sudo nix-channel --update.

  22. canndrew commented on Oct 14, 2016

    @canndrew

    Nope, that didn't change anything. I have nix.nixPath set to point at my own local clone of nixpkgs but that is currently up-to-date with nixpkgs-channels/nixos-unstable. Also I only installed NixOS a couple of weeks ago, after this bug was closed.

    Any more ideas?

  23. chris-martin commented on Oct 14, 2016

    @chris-martin

    I also haven't seen this working yet. I don't use nix-channel at all anymore. Is that a requirement?

  24. edolstra commented on Oct 14, 2016

    @edolstra
    MemberAuthor

    Yeah, you have to use nix-channel because command-not-found looks specifically in /nix/var/nix/profiles/per-user/root/channels/nixos/programs.sqlite.

  25. domenkozar commented on Nov 10, 2016

    @domenkozar
    Member

    Note that generation was disabled again, please comment on #9

  26. locked and limited conversation to collaborators on Nov 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions