jnv: 0.4.2 -> 0.5.0 (#371655)
[NixPkgs.git] / pkgs / applications / editors / emacs / elisp-packages / update-from-overlay
blob5879f4e3eab56b84cc7d685a29b8d60190d3d600
1 #!/usr/bin/env nix-shell
2 #! nix-shell -i bash -p curl nix coreutils
3 set -euxo pipefail
5 # This script piggybacks on the automatic code generation done by the nix-community emacs overlay
6 # You can use this to avoid running lengthy code generation jobs locally
8 export NIXPKGS_ALLOW_BROKEN=1
10 download_change() {
11     local FILE_LOCATION="$1"
13     local BASEURL="https://raw.githubusercontent.com/nix-community/emacs-overlay/master/repos"
15     curl -s -O "${BASEURL}/${FILE_LOCATION}"
18 commit_change() {
19     local MESSAGE="$1"
20     local FILENAME="$2"
22     git diff --exit-code "${FILENAME}" > /dev/null || \
23         git commit -m "${MESSAGE}: updated $(date --iso) (from overlay)" -- "${FILENAME}"
26 test_packageset(){
27     local PKGSET="$1"
29     nix-instantiate --show-trace ../../../../../ -A "emacs.pkgs.$PKGSET"
32 download_change "elpa/elpa-generated.nix"
33 download_change "elpa/elpa-devel-generated.nix"
34 download_change "melpa/recipes-archive-melpa.json"
35 download_change "nongnu/nongnu-generated.nix"
36 download_change "nongnu/nongnu-devel-generated.nix"
38 test_packageset "nongnuPackages"
39 test_packageset "nongnuDevelPackages"
40 test_packageset "elpaPackages"
41 test_packageset "elpaDevelPackages"
42 test_packageset "melpaStablePackages"
43 test_packageset "melpaPackages"
45 commit_change "elpa-packages" "elpa-generated.nix"
46 commit_change "elpa-devel-packages" "elpa-devel-generated.nix"
47 commit_change "melpa-packages" "recipes-archive-melpa.json"
48 commit_change "nongnu-packages" "nongnu-generated.nix"
49 commit_change "nongnu-devel-packages" "nongnu-devel-generated.nix"