Simplify test/shell.nix
And merge shell.head.nix into it. A different version can be passed in as an --arg
This commit is contained in:
parent
ccd1764acb
commit
a706c3527b
2 changed files with 14 additions and 31 deletions
|
@ -1,24 +0,0 @@
|
||||||
# Builds an sandbox for Doom Emacs with Emacs HEAD (27/28). Warning: it compiles
|
|
||||||
# Emacs; this takes a while!
|
|
||||||
#
|
|
||||||
# To create a doom environment w/ Emacs 27/28 with the test config:
|
|
||||||
#
|
|
||||||
# nix-shell shell.head.nix
|
|
||||||
#
|
|
||||||
# Or from a custom DOOMDIR:
|
|
||||||
#
|
|
||||||
# nix-shell --argstr doomdir ~/.config/doom
|
|
||||||
|
|
||||||
{ emacsdir ? "$(pwd)/../"
|
|
||||||
, doomdir ? "$(pwd)"
|
|
||||||
, doomlocaldir ? "$(pwd)/.local.nix.head" }:
|
|
||||||
|
|
||||||
import ./shell.nix rec {
|
|
||||||
pkgs = import <nixpkgs> {
|
|
||||||
overlays = [
|
|
||||||
(import (builtins.fetchTarball https://github.com/nix-community/emacs-overlay/archive/master.tar.gz))
|
|
||||||
];
|
|
||||||
};
|
|
||||||
emacs = pkgs.emacsGit;
|
|
||||||
inherit emacsdir doomdir doomlocaldir;
|
|
||||||
}
|
|
|
@ -1,5 +1,5 @@
|
||||||
# Builds a sandbox for Doom Emacs with the latest stable Emacs (26.3). Use this
|
# Builds a sandbox for Emacs (and optionally, Doom) with a particular version of
|
||||||
# as a basis for module shell.nix's.
|
# Emacs. Use this as a basis for module shell.nix's.
|
||||||
#
|
#
|
||||||
# Usage examples:
|
# Usage examples:
|
||||||
#
|
#
|
||||||
|
@ -10,24 +10,31 @@
|
||||||
# With your own DOOMDIR:
|
# With your own DOOMDIR:
|
||||||
#
|
#
|
||||||
# nix-shell --argstr doomdir ~/.config/doom
|
# nix-shell --argstr doomdir ~/.config/doom
|
||||||
|
#
|
||||||
|
# With a specific version of Emacs
|
||||||
|
#
|
||||||
|
# nix-shell --arg emacs pkgs.emacs # 26.3
|
||||||
|
# nix-shell --arg emacs pkgs.emacsUnstable # 27.x
|
||||||
|
# nix-shell --arg emacs pkgs.emacs # 28+
|
||||||
|
|
||||||
{ pkgs ? (import <nixpkgs> {})
|
{ pkgs ? (import <nixpkgs> {})
|
||||||
, emacs ? pkgs.emacs
|
, emacs ? pkgs.emacs
|
||||||
, emacsdir ? "$(pwd)/.."
|
, emacsdir ? "$(pwd)/.."
|
||||||
, doomdir ? "$(pwd)"
|
, doomdir ? "$(pwd)"
|
||||||
, doomlocaldir ? "$(pwd)/.local.nix" }:
|
, doomlocaldir ? "$(pwd)/.local" }:
|
||||||
|
|
||||||
pkgs.stdenv.mkDerivation {
|
pkgs.stdenv.mkDerivation {
|
||||||
name = "doom-emacs";
|
name = "doom-emacs";
|
||||||
buildInputs = with pkgs; [
|
buildInputs = [
|
||||||
emacs
|
emacs
|
||||||
git
|
pkgs.git
|
||||||
(ripgrep.override {withPCRE2 = true;})
|
(pkgs.ripgrep.override {withPCRE2 = true;})
|
||||||
];
|
];
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
|
export EMACSVERSION="$(emacs --no-site-file --batch --eval '(princ emacs-version)')"
|
||||||
export EMACSDIR="$(readlink -f "${emacsdir}")/"
|
export EMACSDIR="$(readlink -f "${emacsdir}")/"
|
||||||
export DOOMDIR="$(readlink -f "${doomdir}")/"
|
export DOOMDIR="$(readlink -f "${doomdir}")/"
|
||||||
export DOOMLOCALDIR="$(readlink -f "${doomlocaldir}")/"
|
export DOOMLOCALDIR="$(readlink -f "${doomlocaldir}").$EMACSVERSION/"
|
||||||
export PATH="$EMACSDIR/bin:$PATH"
|
export PATH="$EMACSDIR/bin:$PATH"
|
||||||
echo "EMACSDIR=$EMACSDIR"
|
echo "EMACSDIR=$EMACSDIR"
|
||||||
echo "DOOMDIR=$DOOMDIR"
|
echo "DOOMDIR=$DOOMDIR"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue