New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor command-not-found #24962
Refactor command-not-found #24962
Conversation
43f1b7f
to
77d8cc0
Compare
options.programs.command-not-found = { | ||
|
||
enable = mkOption { | ||
default = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would even argue to disable this at the moment, because the sqlite database is almost empty since 16.09:
16.03:
$ sqlite3 /nix/var/nix/profiles/per-user/joerg/channels/nixos/programs.sqlite "select count(*) from Programs;"
23209
16.09:
$ sqlite3 /nix/var/nix/profiles/per-user/joerg/channels/nixos/programs.sqlite "select count(*) from Programs;"
653
17.03:
$ sqlite3 /nix/var/nix/profiles/per-user/joerg/channels/nixos/programs.sqlite "select count(*) from Programs;"
343
@Mic92 i wanted to preserve the original behavior but you are right, with the current state it would be best to disable them by default. |
add option to disable command-not-found as well as option to define dbPath. Disabling this may remove the perl dependency for bash/zsh prompts
77d8cc0
to
5a5db60
Compare
Anybody who want to fix |
@edolstra did some work with nar listing files recently. I also had a separate proposal for fixing it inside nixpkgs, but we decided to follow the nar listing files instead. If that isn't working properly, we might consider reviving my other proposal, which I think is easier to maintain without special support from Nix/Hydra or assumptions about binary caches. |
@copumpkin This PR only provides a way to enable and disable I'd really like to see my PR being merged to avoid having to maintain a fork of nixpkgs with this commit cherry-picked on top for the rest of eternity ;) |
Motivation for this change
as of right now command-not-found is not working because programs.sqlite is not populated inside the channels. I took this as a chance to customize the current command-not-found module.
With
programs.command-not-found.enable
the feature can be disabled if unneeded.With
programs.command-not-found.dbPath
the path to the db can be specified explicitly in case no channels are in use.Things done
./result/bin/
)