-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
119 lines (106 loc) · 2.69 KB
/
flake.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
113
114
115
116
117
118
119
{
description = "Pure Emacs apps";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
twist = {
url = "github:emacs-twist/twist.nix";
};
org-babel.url = "github:emacs-twist/org-babel";
melpa = {
url = "github:melpa/melpa";
flake = false;
};
gnu-elpa = {
url = "git+https://git.savannah.gnu.org/git/emacs/elpa.git?ref=main";
flake = false;
};
nongnu = {
url = "git+https://git.savannah.gnu.org/git/emacs/nongnu.git?ref=main";
flake = false;
};
epkgs = {
url = "github:emacsmirror/epkgs";
flake = false;
};
emacs = {
url = "github:emacs-mirror/emacs";
flake = false;
};
emacs-unstable.url = "github:nix-community/emacs-overlay";
# Configuration repositories
terlar = {
url = "github:terlar/emacs-config";
# Simply import as an Emacs configuration repository
flake = false;
};
scimax = {
url = "github:jkitchin/scimax";
flake = false;
};
};
outputs = {
self,
nixpkgs,
flake-utils,
twist,
...
} @ inputs:
flake-utils.lib.eachDefaultSystem
(system: let
inherit (nixpkgs) lib;
pkgs = import nixpkgs {
inherit system;
overlays = [
inputs.org-babel.overlays.default
inputs.twist.overlays.default
];
};
inventories = import ./lib/inventories.nix inputs;
inherit (inputs.emacs-unstable.packages.${system}) emacs-unstable emacs-git;
profiles = {
terlar = import ./profiles/terlar {
inherit pkgs;
inherit (inputs) terlar;
emacsPackage = emacs-git;
};
scimax = import ./profiles/scimax {
inherit pkgs;
inherit (inputs) scimax;
emacsPackage = emacs-unstable;
inherit
(twist.lib {inherit lib;})
parseUsePackages
emacsBuiltinLibraries
;
};
};
packages =
lib.mapAttrs (
_: attrs:
pkgs.callPackage ./lib/profile.nix ({
inherit inventories;
withSandbox = pkgs.callPackage ./lib/sandbox.nix {};
}
// attrs)
)
profiles;
in {
inherit packages;
apps = lib.pipe packages [
(lib.mapAttrsToList (
name: package: let
apps = package.makeApps {
lockDirName = "profiles/${name}/lock";
};
in
lib.mapAttrsToList (appName: app: {
name = "${appName}-${name}";
value = app;
})
apps
))
lib.concatLists
lib.listToAttrs
];
});
}