Skip to content

Commit

Permalink
melpa: Hack update script not to use broken nix
Browse files Browse the repository at this point in the history
  • Loading branch information
adisbladis committed Nov 4, 2024
1 parent 9251d6e commit 8aa36a5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions repos/melpa/update
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
#!/usr/bin/env nix-shell
#! nix-shell -i bash -p bash
#! nix-shell -i bash -p bash jq
set -euxo pipefail

SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
cd $SCRIPTPATH

eval $(nix-instantiate --eval --expr 'let nixpath = builtins.toString (import <nixpkgs> {}).path; in "${nixpath}/pkgs/applications/editors/emacs/elisp-packages/update-melpa"')
# Hack updater env not to use broken Nix
elisp_packages=$(nix-instantiate --eval --expr 'let nixpath = builtins.toString (import <nixpkgs> {}).path; in "${nixpath}/pkgs/applications/editors/emacs/elisp-packages"' | jq -r)
update_script="$elisp_packages/update-melpa"
update_env="$elisp_packages/updater-emacs.nix"
sed s/'pkgs = .*'/'pkgs = import <nixpkgs> { };'/ "$update_env" | grep -vP ' *pkgs\.nix$' > shell.nix

nix-shell shell.nix --run "bash $update_script"

env NIXPKGS_ALLOW_BROKEN=1 nix-instantiate --show-trace ./test.nix -A melpaStablePackages
env NIXPKGS_ALLOW_BROKEN=1 nix-instantiate --show-trace ./test.nix -A melpaPackages

0 comments on commit 8aa36a5

Please sign in to comment.