diff --git a/shared/bash.nix b/shared/bash.nix new file mode 100644 index 0000000..9f66b29 --- /dev/null +++ b/shared/bash.nix @@ -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 + } + ''; +} diff --git a/shared/default.nix b/shared/default.nix index 0f1bb04..c022965 100644 --- a/shared/default.nix +++ b/shared/default.nix @@ -1,6 +1,7 @@ { ... }: { imports = [ + ./bash.nix ./caches.nix ./gpg.nix ./sops.nix