forked from ashton314/emacs-bedrock
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevenv.nix
More file actions
86 lines (77 loc) · 2.29 KB
/
devenv.nix
File metadata and controls
86 lines (77 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{
pkgs,
lib,
config,
inputs,
...
}:
let
pkgs-30-1 = import inputs.nixpkgs-30-1 { system = pkgs.stdenv.system; };
pkgs-29-4 = import inputs.nixpkgs-29-4 {
system = pkgs.stdenv.system;
config = {
allowInsecurePredicate = pkg: builtins.elem (lib.getName pkg) [ "emacs" ];
};
};
pkgs-29-3 = import inputs.nixpkgs-29-3 { system = pkgs.stdenv.system; };
pkgs-29-2 = import inputs.nixpkgs-29-2 { system = pkgs.stdenv.system; };
pkgs-29-1 = import inputs.nixpkgs-29-1 { system = pkgs.stdenv.system; };
renameEmacs =
pkgs: newName:
pkgs.symlinkJoin {
name = newName;
paths = [ pkgs.emacs ];
postBuild = ''
mkdir -p $out/bin
ln -s ${pkgs.emacs}/bin/emacs $out/bin/${newName}
'';
};
# TODO(shackra): add scripts for running emacs in -nw and as a daemon
prepareTestDir = (pkgs.writeShellScriptBin "prepare" (builtins.readFile ./etc/scripts/prepare.sh));
prepareAndRunTest = (
pkgs.writeShellScriptBin "prepare-and-run" (builtins.readFile ./etc/scripts/prepare-and-run.sh)
);
runE2eTreesit = (
pkgs.writeShellScriptBin "run-e2e-treesit" (builtins.readFile ./etc/scripts/run-e2e-treesit.sh)
);
run-for-each-emacs = (
pkgs.writeShellScriptBin "for-each-emacs" (builtins.readFile ./etc/scripts/for-each-emacs.sh)
);
driveConf = (pkgs.writeShellScriptBin "drive-conf" (builtins.readFile ./etc/scripts/drive-conf.sh));
# Wrapper that auto-fills the project dir from $DEVENV_ROOT
driveConfHere = (
pkgs.writeShellScriptBin "drive-conf-here" ''
exec drive-conf "$@" "$BACKPACK_ROOT"
''
);
in
{
env = {
EMACS_VERSIONS_TO_TEST = "emacs-rolling emacs-30-1 emacs-29-4 emacs-29-3 emacs-29-2 emacs-29-1";
};
packages = [
pkgs.git
pkgs.rsync
prepareTestDir
prepareAndRunTest
runE2eTreesit
run-for-each-emacs
driveConf
driveConfHere
(renameEmacs pkgs "emacs-rolling")
(renameEmacs pkgs-30-1 "emacs-30-1")
(renameEmacs pkgs-29-4 "emacs-29-4")
(renameEmacs pkgs-29-3 "emacs-29-3")
(renameEmacs pkgs-29-2 "emacs-29-2")
(renameEmacs pkgs-29-1 "emacs-29-1")
# development files
pkgs.enchant.dev # for jinx
];
enterShell = ''
export BACKPACK_ROOT="$DEVENV_ROOT"
'';
enterTest = ''
for-each-emacs $DEVENV_ROOT/.
exit $?
'';
}