-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofile.nix
112 lines (101 loc) · 2.81 KB
/
profile.nix
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
{
emacsTwist,
lib,
cmake,
gcc,
sqlite,
libvterm-neovim,
withSandbox,
inventories,
# Profile-specific
emacsPackage,
initFiles,
lockDir,
extraPackages,
extraRecipeDir,
extraInputOverrides,
sandboxArgs ? _: {},
}:
with builtins; let
package =
(emacsTwist {
inherit initFiles;
inherit emacsPackage;
inherit lockDir;
inherit extraPackages;
nativeCompileAheadDefault = false;
inventories =
[
{
type = "melpa";
path = extraRecipeDir;
}
]
++ inventories;
inputOverrides = (import ./inputs.nix {inherit lib;}) // extraInputOverrides;
})
.overrideScope' (self: super: {
elispPackages = super.elispPackages.overrideScope' (eself: esuper: {
vterm = esuper.vterm.overrideAttrs (old: {
# Based on the configuration in nixpkgs available at the following URL:
# https://github.com/NixOS/nixpkgs/blob/af21d41260846fb9c9840a75e310e56dfe97d6a3/pkgs/applications/editors/emacs/elisp-packages/melpa-packages.nix#L483
nativeBuildInputs = [cmake gcc];
buildInputs = old.buildInputs ++ [libvterm-neovim];
cmakeFlags = [
"-DEMACS_SOURCE=${super.emacs.src}"
];
preBuild = ''
mkdir -p build
cd build
cmake ..
make
install -m444 -t . ../*.so
install -m600 -t . ../*.el
cp -r -t . ../etc
rm -rf {CMake*,build,*.c,*.h,Makefile,*.cmake}
'';
});
pdf-tools = esuper.pdf-tools.overrideAttrs (old: {
preBuild = ''
mkdir build
'';
});
emacsql = esuper.emacsql.overrideAttrs (old: {
buildInputs = old.buildInputs ++ [sqlite];
postBuild = ''
cd sqlite
make
cd ..
'';
});
sqlite3 = esuper.sqlite3.overrideAttrs (old: {
buildInputs = old.buildInputs ++ [sqlite];
postBuild = ''
make
'';
});
# Exclude info outputs that fail to build.
sml-mode = esuper.sml-mode.overrideAttrs (old: {
outputs = ["out"];
});
geiser = esuper.geiser.overrideAttrs (old: {
outputs = ["out"];
});
ess = esuper.ess.overrideAttrs (old: {
outputs = ["out"];
});
queue = esuper.queue.overrideAttrs (old: {
outputs = ["out"];
});
# scimax
# > ov-highlight.el:170:1: Error: Wrong type argument: proper-list-p, (p . v)
ov-highlight = esuper.ov-highlight.overrideAttrs (old: {
dontByteCompile = true;
});
});
});
in
lib.extendDerivation true {
sandboxed = withSandbox package (sandboxArgs package);
}
package