nixos-config/shared/bash.nix

13 lines
413 B
Nix
Raw Normal View History

2023-04-14 11:56:42 +02:00
{ ... }:
{
programs.bash.shellInit = ''
download_nixpkgs_cache_index () {
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.
wget -q -N https://github.com/Mic92/nix-index-database/releases/latest/download/$filename
ln -f $filename files
}
'';
}