emacs-packages: Allow update script to be called from any location

Previously working directory was important
This commit is contained in:
adisbladis 2019-08-03 20:42:26 +01:00
parent 9c0f22a45b
commit 8911226971
No known key found for this signature in database
GPG Key ID: 110BFAD44C6249B7
2 changed files with 41 additions and 32 deletions

View File

@ -1,8 +1,6 @@
#! /usr/bin/env nix-shell
#! nix-shell --show-trace -i sh -p git nix nix-prefetch-git nix-prefetch-hg "import ./updater-emacs.nix"
#! nix-shell --show-trace ./updater-emacs.nix -i bash
# "with import ../../../.. {}; emacsWithPackages (epkgs: with epkgs.melpaPackages; [ promise semaphore ])"
SCRIPT_DIR="$( cd "$(dirname "$0")" ; pwd -P )"
exec emacs --fg-daemon=updater --quick -l update-melpa.el -f run-updater "$@"
# exec emacs update-melpa.el "$@"
exec emacs --fg-daemon=updater --quick -l $SCRIPT_DIR/update-melpa.el -f run-updater "$@"

View File

@ -1,29 +1,40 @@
with import ../../../.. {};
(emacsPackagesNgFor emacs26).
emacsWithPackages (epkgs: let
promise = epkgs.trivialBuild {
pname = "promise";
version = "1";
src = fetchFromGitHub {
owner = "bendlas";
repo = "emacs-promise";
rev = "4da97087c5babbd8429b5ce62a8323b9b03c6022";
sha256 = "0yin7kj69g4zxs30pvk47cnfygxlaw7jc7chr3b36lz51yqczjsy";
let
pkgs = import ../../../.. {};
emacsEnv = (pkgs.emacsPackagesNgFor pkgs.emacs26).emacsWithPackages (epkgs: let
promise = epkgs.trivialBuild {
pname = "promise";
version = "1";
src = pkgs.fetchFromGitHub {
owner = "bendlas";
repo = "emacs-promise";
rev = "4da97087c5babbd8429b5ce62a8323b9b03c6022";
sha256 = "0yin7kj69g4zxs30pvk47cnfygxlaw7jc7chr3b36lz51yqczjsy";
};
};
};
semaphore = epkgs.trivialBuild {
pname = "semaphore";
version = "1";
packageRequires = [ promise ];
src = fetchFromGitHub {
owner = "webnf";
repo = "semaphore.el";
rev = "93802cb093073bc6a6ccd797328dafffcef248e0";
sha256 = "09pfyp27m35sv340xarhld7xx2vv5fs5xj4418709iw6l6hpk853";
semaphore = epkgs.trivialBuild {
pname = "semaphore";
version = "1";
packageRequires = [ promise ];
src = pkgs.fetchFromGitHub {
owner = "webnf";
repo = "semaphore.el";
rev = "93802cb093073bc6a6ccd797328dafffcef248e0";
sha256 = "09pfyp27m35sv340xarhld7xx2vv5fs5xj4418709iw6l6hpk853";
};
};
};
in [ promise semaphore ]
# ++ (with epkgs.melpaPackages; [ smex rainbow-delimiters paredit ])
)
in [ promise semaphore ]);
in pkgs.mkShell {
buildInputs = [
pkgs.git
pkgs.nix
pkgs.bash
pkgs.nix-prefetch-git
pkgs.nix-prefetch-hg
emacsEnv
];
}