@Aravind Gopal You were talking about this -- telling the user to display a nix-friendly message when they try to run something that's not already (thus not encouraging them towards of homebrew and the like).
Let me find the config I have for this.
This uses a program called nix-index
, which uses old-style commands unfortunately: https://github.com/nix-community/nix-index/issues/191
^ Potential OSS contribution here
Here's the home-manager config for enabling this:
programs = {
nix-index = {
enable = true;
enableZshIntegration = true;
};
}
https://github.com/juspay/nix-dev-home/commit/4f4ab11b5f76c054289969d3927e6bbc31e2d981
Oh, nix-index does use new style commands but only if ~/.nix-profile/manifest.json
exists:
https://github.com/nix-community/nix-index/commit/cd7cdcb06f3552fc55cf0cded66de90461006c00
I did nix profile install nixpkgs#hello
just to populate this manifest, and now it shows the right thing:
$ cat .nix-profile/manifest.json
{"elements":[],"version":2}
This is a good tool to motivate users towards full nix.
One glitch. The installation is not seamless. You need to generate the index manually the first time,
@Aravind Gopal We've automated the nix-index DB generation part,
https://github.com/juspay/nix-dev-home/pull/14
Last updated: Nov 15 2024 at 12:33 UTC