-
Notifications
You must be signed in to change notification settings - Fork 0
/
nixmacs.nix
44 lines (42 loc) · 1.21 KB
/
nixmacs.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
{ pkgs, lib, package, modules, overrides, configurationFile, docs, extraOverrides }:
with lib;
let
emacsPackages = let
epkgs = pkgs.emacsPackagesFor package;
in (epkgs.overrideScope' overrides).overrideScope' extraOverrides;
emacsPackage = (
emacsPackages.emacsWithPackages (
epkgs:
let
pkgsModule = {
config._module.args.pkgs = pkgs;
config._module.args.epkgs = epkgs;
config._module.check = true;
};
evaledModule = evalModules {
modules = [ configurationFile pkgsModule ] ++ modules;
};
in
{
inherit (evaledModule.config) rawPackageList initEl externalPackageList;
}
)
).overrideAttrs (
oldAttrs:
let
oldReqs = oldAttrs.explicitRequires;
explicitRequires = oldReqs.rawPackageList;
in
{
inherit explicitRequires;
passthru = {
inherit (oldReqs) initEl externalPackageList;
};
deps = oldAttrs.deps.overrideAttrs (o: { inherit explicitRequires; });
}
);
in
pkgs.callPackage ./nixmacs {
inherit emacsPackage docs;
inherit (emacsPackage.passthru) initEl externalPackageList;
}