-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdoom.nix
182 lines (164 loc) · 4.5 KB
/
doom.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
{
config,
lib,
pkgs,
pkgs-emacs,
pkgs-stable,
inputs,
userSettings,
systemSettings,
...
}: let
themePolarity = lib.removeSuffix "\n" (builtins.readFile (./. + "../../../../themes" + ("/" + userSettings.theme) + "/polarity.txt"));
dashboardLogo = ./. + "/nix-" + themePolarity + ".webp";
in {
imports = [
inputs.nix-doom-emacs.hmModule
../git/git.nix
../../shell/sh.nix
../../shell/cli-collection.nix
];
programs.doom-emacs = {
enable = true;
emacsPackage = pkgs-emacs.emacs29-pgtk;
doomPrivateDir = ./.;
# This block from https://github.com/znewman01/dotfiles/blob/be9f3a24c517a4ff345f213bf1cf7633713c9278/emacs/default.nix#L12-L34
# Only init/packages so we only rebuild when those change.
doomPackageDir = let
filteredPath = builtins.path {
path = ./.;
name = "doom-private-dir-filtered";
filter = path: type:
builtins.elem (baseNameOf path) ["init.el" "packages.el"];
};
in
pkgs-emacs.linkFarm "doom-packages-dir" [
{
name = "init.el";
path = "${filteredPath}/init.el";
}
{
name = "packages.el";
path = "${filteredPath}/packages.el";
}
{
name = "config.el";
path = pkgs-emacs.emptyFile;
}
];
# End block
};
home.file.".emacs.d/themes/doom-stylix-theme.el".source = config.lib.stylix.colors {
template = builtins.readFile ./themes/doom-stylix-theme.el.mustache;
extension = ".el";
};
home.packages =
(with pkgs-emacs; [
emacs-lsp-booster
file
wmctrl
jshon
aria
hledger
hunspell
hunspellDicts.en_US-large
(pkgs-emacs.mu.override {emacs = emacs29-pgtk;})
(pkgs.callPackage ./pkgs/org-analyzer.nix {})
emacsPackages.mu4e
isync
msmtp
(python3.withPackages (p:
with p; [
pandas
requests
epc
lxml
pysocks
pymupdf
markdown
]))
])
++ (with pkgs-stable; [
nodejs
nodePackages.mermaid-cli
])
++ (with pkgs; [
openssl
stunnel
]);
services.mbsync = {
enable = true;
package = pkgs-stable.isync;
frequency = "*:0/5";
};
home.file.".emacs.d/org-yaap" = {
source = "${inputs.org-yaap}";
recursive = true;
};
home.file.".emacs.d/org-side-tree" = {
source = "${inputs.org-side-tree}";
recursive = true;
};
home.file.".emacs.d/org-timeblock" = {
source = "${inputs.org-timeblock}";
recursive = true;
};
home.file.".emacs.d/org-nursery" = {
source = "${inputs.org-nursery}";
};
home.file.".emacs.d/org-krita" = {
source = "${inputs.org-krita}";
};
home.file.".emacs.d/org-xournalpp" = {
source = "${inputs.org-xournalpp}";
};
home.file.".emacs.d/org-sliced-images" = {
source = "${inputs.org-sliced-images}";
};
home.file.".emacs.d/magit-file-icons" = {
source = "${inputs.magit-file-icons}";
};
home.file.".emacs.d/dashboard-logo.webp".source = dashboardLogo;
home.file.".emacs.d/scripts/copy-link-or-file/copy-link-or-file-to-clipboard.sh" = {
source = ./scripts/copy-link-or-file/copy-link-or-file-to-clipboard.sh;
executable = true;
};
home.file.".emacs.d/phscroll" = {
source = "${inputs.phscroll}";
};
home.file.".emacs.d/mini-frame" = {
source = "${inputs.mini-frame}";
};
home.file.".emacs.d/system-vars.el".text =
''
;;; ~/.emacs.d/config.el -*- lexical-binding: t; -*-
;; Import relevant variables from flake into emacs
(setq user-full-name "''
+ userSettings.name
+ '' ") ; name
(setq user-username "''
+ userSettings.username
+ '' ") ; username
(setq user-mail-address "''
+ userSettings.email
+ '' ") ; email
(setq user-home-directory "/home/''
+ userSettings.username
+ '' ") ; absolute path to home directory as string
(setq user-default-roam-dir "''
+ userSettings.defaultRoamDir
+ '' ") ; absolute path to home directory as string
(setq system-nix-profile "''
+ systemSettings.profile
+ '' ") ; what profile am I using?
(setq system-wm-type "''
+ userSettings.wmType
+ '' ") ; wayland or x11?
(setq doom-font (font-spec :family "''
+ userSettings.font
+ '' " :size 20)) ; import font
(setq dotfiles-dir "''
+ userSettings.dotfilesDir
+ '' ") ; import location of dotfiles directory
'';
}