mirror of
https://git.sr.ht/~rouven/nixos-config
synced 2024-11-15 05:13:10 +01:00
add index download function to bash
This commit is contained in:
parent
889c6939cf
commit
be735ec0e7
12
shared/bash.nix
Normal file
12
shared/bash.nix
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
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
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
{ ... }:
|
{ ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
./bash.nix
|
||||||
./caches.nix
|
./caches.nix
|
||||||
./gpg.nix
|
./gpg.nix
|
||||||
./sops.nix
|
./sops.nix
|
||||||
|
|
Loading…
Reference in a new issue