elisp-packages: upgrade update-from-overlay script

Now this new updater:

- is more modular: uses cute functions for download and commit
- and also includes nongnu packages!
This commit is contained in:
AndersonTorres 2022-09-10 14:49:24 -03:00
parent 3bb47517fa
commit dc4deda135

View file

@ -1,17 +1,37 @@
#!/usr/bin/env nix-shell #!/usr/bin/env nix-shell
#! nix-shell -i bash -p curl nix #! nix-shell -i bash -p curl nix coreutils
set -euxo pipefail set -euxo pipefail
export NIXPKGS_ALLOW_BROKEN=1
# This script piggybacks on the automatic code generation done by the nix-community emacs overlay # This script piggybacks on the automatic code generation done by the nix-community emacs overlay
# You can use this to avoid running lengthy code generation jobs locally # You can use this to avoid running lengthy code generation jobs locally
curl -s -O https://raw.githubusercontent.com/nix-community/emacs-overlay/master/repos/elpa/elpa-generated.nix export NIXPKGS_ALLOW_BROKEN=1
nix-instantiate ../../../../../ -A emacs.pkgs.elpaPackages --show-trace
git diff --exit-code elpa-generated.nix > /dev/null || git commit -m "emacs.pkgs.elpa-packages: $(date --iso)" -- elpa-generated.nix
curl -s -O https://raw.githubusercontent.com/nix-community/emacs-overlay/master/repos/melpa/recipes-archive-melpa.json download_change() {
local FILE_LOCATION="$1"
local BASEURL="https://raw.githubusercontent.com/nix-community/emacs-overlay/master/repos"
curl -s -O "${BASEURL}/${FILE_LOCATION}"
}
commit_change() {
local MESSAGE="$1"
local FILENAME="$2"
git diff --exit-code "${FILENAME}" > /dev/null || \
git commit -m "${MESSAGE}: updated $(date --iso) (from overlay)" -- "${FILENAME}"
}
download_change "elpa/elpa-generated.nix"
nix-instantiate ../../../../../ -A emacs.pkgs.elpaPackages --show-trace
commit_change "elpa-packages" "elpa-generated.nix"
download_change "melpa/recipes-archive-melpa.json"
nix-instantiate --show-trace ../../../../../ -A emacs.pkgs.melpaStablePackages nix-instantiate --show-trace ../../../../../ -A emacs.pkgs.melpaStablePackages
nix-instantiate --show-trace ../../../../../ -A emacs.pkgs.melpaPackages nix-instantiate --show-trace ../../../../../ -A emacs.pkgs.melpaPackages
git diff --exit-code recipes-archive-melpa.json > /dev/null || git commit -m "emacs.pkgs.melpa-packages: $(date --iso)" -- recipes-archive-melpa.json commit_change "melpa-packages" "recipes-archive-melpa.json"
download_change "nongnu/nongnu-generated.nix"
nix-instantiate --show-trace ../../../../../ -A emacs.pkgs.nongnuPackages
commit_change "nongnu-packages" "nongnu-generated.nix"