Stream: nix

Topic: nix-index


view this post on Zulip Srid (Jan 19 2024 at 06:59):

image.png

@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.

view this post on Zulip Srid (Jan 19 2024 at 07:00):

This uses a program called nix-index, which uses old-style commands unfortunately: https://github.com/nix-community/nix-index/issues/191

view this post on Zulip Srid (Jan 19 2024 at 07:02):

^ Potential OSS contribution here

view this post on Zulip Srid (Jan 19 2024 at 07:03):

Here's the home-manager config for enabling this:

  programs = {
    nix-index = {
      enable = true;
      enableZshIntegration = true;
    };
  }

view this post on Zulip Srid (Jan 19 2024 at 07:04):

https://github.com/juspay/nix-dev-home/commit/4f4ab11b5f76c054289969d3927e6bbc31e2d981

view this post on Zulip Srid (Jan 19 2024 at 07:06):

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

view this post on Zulip Srid (Jan 19 2024 at 07:08):

I did nix profile install nixpkgs#hello just to populate this manifest, and now it shows the right thing:

image.png

view this post on Zulip Srid (Jan 19 2024 at 07:12):

$ cat .nix-profile/manifest.json
{"elements":[],"version":2}

view this post on Zulip Aravind Gopal (Jan 19 2024 at 08:31):

This is a good tool to motivate users towards full nix.

view this post on Zulip Srid (Jan 19 2024 at 08:42):

One glitch. The installation is not seamless. You need to generate the index manually the first time,

image.png

view this post on Zulip Srid (Feb 10 2024 at 07:26):

@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