l: init nix-index-update

This commit is contained in:
lassulus 2023-09-04 13:51:36 +02:00
parent b2ff846845
commit 73b17ef250

View file

@ -0,0 +1,9 @@
{ pkgs }:
pkgs.writers.writeDashBin "nix-index-update" ''
set -efux
filename="index-$(uname -m)-$(uname | tr A-Z a-z)"
mkdir -p ~/.cache/nix-index && cd ~/.cache/nix-index
# -N will only download a new version if there is an update.
${pkgs.wget}/bin/wget -q -N https://github.com/Mic92/nix-index-database/releases/latest/download/$filename
ln -f $filename files
''