nix-community / nix-index

Quickly locate nix packages with specific files [maintainers=@bennofs @figsoda @raitobezarius]
Other
851 stars 48 forks source link

Offer periodic database snapshots #142

Open fzakaria opened 3 years ago

fzakaria commented 3 years ago

Love the tool. Running it on my laptop eats my whole NIC, I can't even browse the internet (wow fast!)

I was curious if you have thought of a way to periodically update/create a snapshot we can all share?

nix-index-service and host the latest using some CDN.

Would be really interesting to do that & maybe put a frontend layer on it.

Would love to contribute and brainstorm.

Mic92 commented 3 years ago

I built it: https://github.com/Mic92/nix-index-database/releases/latest

@fzakaria maybe you can add some home-manager configuration or so to place it in .cache/nix-index?

Mic92 commented 3 years ago
nix-index-update() {
  tag=$(git -c 'versionsort.suffix=-' \
    ls-remote \
    --exit-code \
    --refs \
    --tags \
    --sort='v:refname' \
    https://github.com/Mic92/nix-index-database \
    | awk 'END {match($2, /([^/]+)$/, m); print m[0]}')
  curl -L "https://github.com/Mic92/nix-index-database/releases/download/$tag/files" -o $XDG_RUNTIME_DIR/files-$tag
  mv $XDG_RUNTIME_DIR/files-$tag $HOME/.cache/nix-index/files
}
fzakaria commented 3 years ago

@Mic92 for things like this, is it worthwhile to bundle it alongside the nix-index derivation in nixpkgs ? That could be something very easily that Ryan's bot updates ?

Mic92 commented 3 years ago

@Mic92 for things like this, is it worthwhile to bundle it alongside the nix-index derivation in nixpkgs ? That could be something very easily that Ryan's bot updates ?

Could be also for releases a different branch might be interesting.