tangled
alpha
login
or
join now
thevoid.cafe
/
puzzlevision
0
fork
atom
Non stop entertainment! The wackiest NixOS configuration to-date.
thevoid.cafe/projects/puzzlevision
nixos
flake
flake-parts
dotfiles
home-manager
nix
0
fork
atom
overview
issues
pulls
pipelines
🔧⚰️ Clean up Zed configuration
thevoid.cafe
3 weeks ago
22a1fae5
72b1f3a4
verified
This commit was signed with the committer's
known signature
.
thevoid.cafe
SSH Key Fingerprint:
SHA256:6LamuiiF+oLDOqy13Locb95HiqZGy8CIaFHI8miR6hE=
4/4
nix-flake-check.yaml
success
1m 8s
nix-format-check.yaml
success
6s
nix-locker-check.yaml
success
49s
trufflehog-scan.yaml
success
5s
+72
-73
1 changed file
expand all
collapse all
unified
split
modules
home
apps
zed
default.nix
+72
-73
modules/home/apps/zed/default.nix
reviewed
···
14
14
options.${namespace}.apps.zed = {
15
15
enable = mkEnableOption "Zed, the graphical editor from the future, with a sane base configuration.";
16
16
enable-nix = mkEnableOption "support for the Nix language, based on nixd, in Zed.";
17
17
-
enable-php = mkEnableOption "support for the PHP language, based on phpactor and pretty-php, in Zed.";
17
17
+
enable-php = mkEnableOption "support for the PHP language, based on intelephense and pretty-php, in Zed.";
18
18
enable-python = mkEnableOption "support for the Python language, based on pylsp, in Zed.";
19
19
enable-typescript = mkEnableOption "support for the TypeScript language, based on bun and oxc, in Zed.";
20
20
};
···
23
23
programs.zed-editor = {
24
24
enable = true;
25
25
26
26
+
## Make Zed config files immutable
27
27
+
mutableUserDebug = false;
28
28
+
mutableUserKeymaps = false;
29
29
+
mutableUserSettings = false;
30
30
+
mutableUserTasks = false;
31
31
+
32
32
+
## Enable extensions, based on enabled languages
33
33
+
extensions = [
34
34
+
"oxc"
35
35
+
"sql"
36
36
+
"fish"
37
37
+
"html"
38
38
+
"scss"
39
39
+
"svelte"
40
40
+
"wakatime"
41
41
+
"dockerfile"
42
42
+
"docker-compose"
43
43
+
]
44
44
+
++ lib.optionals cfg.enable-nix [
45
45
+
"nix"
46
46
+
]
47
47
+
++ lib.optionals cfg.enable-php [
48
48
+
"php"
49
49
+
]
50
50
+
++ lib.optionals cfg.enable-python [
51
51
+
"pylsp"
52
52
+
]
53
53
+
++ lib.optionals config.catppuccin.enable [
54
54
+
"catppuccin"
55
55
+
"catppuccin-icons"
56
56
+
]
57
57
+
++ lib.optionals config.programs.nixcord.enable [
58
58
+
"discord-presence"
59
59
+
];
60
60
+
61
61
+
## Install additional packages, based on enable languages
62
62
+
extraPackages =
63
63
+
with pkgs;
64
64
+
[ ]
65
65
+
++ lib.optionals cfg.enable-typescript [
66
66
+
oxlint
67
67
+
oxfmt
68
68
+
bun
69
69
+
vtsls
70
70
+
]
71
71
+
++ lib.optionals cfg.enable-nix [
72
72
+
nixd
73
73
+
nixfmt
74
74
+
]
75
75
+
++ lib.optionals cfg.enable-python [
76
76
+
python3Packages.python-lsp-server
77
77
+
]
78
78
+
++ lib.optionals cfg.enable-php [
79
79
+
php
80
80
+
phpPackages.composer
81
81
+
pretty-php
82
82
+
intelephense
83
83
+
];
84
84
+
85
85
+
## Configure Zed user settings
26
86
userSettings = {
27
87
### Disable telemetry
28
88
telemetry = {
···
36
96
37
97
### Disable AI features
38
98
disable_ai = true;
39
39
-
40
40
-
### Theme settings
41
41
-
icon_theme = mkForce {
42
42
-
dark = mkIf config.catppuccin.enable "Catppuccin Macchiato";
43
43
-
light = mkIf config.catppuccin.enable "Catppuccin Latte";
44
44
-
};
45
45
-
46
46
-
theme = mkForce {
47
47
-
dark = mkIf config.catppuccin.enable "Catppuccin Macchiato (blue)";
48
48
-
light = mkIf config.catppuccin.enable "Catppuccin Latte (blue)";
49
49
-
};
50
99
51
100
### Formatting and saving settings
52
101
formatter = "language_server";
53
53
-
format_on_save = "on";
54
102
autosave.after_delay.milliseconds = 0;
55
55
-
56
56
-
diagnostics.inline.enable = true;
57
103
58
104
indent_guides = {
59
105
enable = true;
60
106
coloring = "indent_aware";
61
107
};
62
108
63
63
-
hard_tabs = true;
64
64
-
tab_size = 4;
65
65
-
soft_wrap = "preferred_line_length";
109
109
+
### Line-length limits and wrapping configuration
110
110
+
soft_wrap = "bounded";
111
111
+
preferred_line_length = 100;
66
112
67
113
### Language specific configurations
68
114
languages = {
115
115
+
#### Nix
69
116
Nix = mkIf cfg.enable-nix {
70
117
language_servers = [
71
118
"!nil"
···
81
128
82
129
tab_size = 2;
83
130
};
131
131
+
#### PHP
84
132
PHP = mkIf cfg.enable-php {
85
133
language_servers = [
86
134
"!phpactor"
···
95
143
};
96
144
};
97
145
};
146
146
+
#### TypeScript
98
147
TypeScript = mkIf cfg.enable-typescript {
99
148
language_servers = [
100
149
"!eslint"
150
150
+
"!prettier"
151
151
+
"!typescript-language-server"
101
152
"oxfmt"
102
153
"oxlint"
103
154
"vtsls"
···
146
197
"${config.home.homeDirectory}/Documents/Development/Libraries"
147
198
];
148
199
};
149
149
-
150
150
-
format = {
151
151
-
enable = false;
152
152
-
};
153
153
-
154
154
-
maxMemory = 256;
155
200
};
156
201
};
157
202
};
158
203
159
159
-
### Base editor configurations
204
204
+
### Basic editor settings
205
205
+
hour_format = "hour24";
160
206
auto_update = false;
161
161
-
auto_install_extension = {
162
162
-
# Web dev
163
163
-
html = true;
164
164
-
svelte = true;
165
165
-
scss = true;
166
166
-
oxc = true;
167
167
-
168
168
-
# Languages
169
169
-
nix = cfg.enable-nix;
170
170
-
php = cfg.enable-php;
171
171
-
sql = true;
172
172
-
toml = true;
173
173
-
pylsp = cfg.enable-python; # Python
174
174
-
fish = true;
175
175
-
176
176
-
# Docker
177
177
-
dockerfile = true;
178
178
-
docker-compose = true;
179
179
-
180
180
-
# Theming
181
181
-
catppuccin = config.catppuccin.enable;
182
182
-
catppuccin-icons = config.catppuccin.enable;
183
183
-
184
184
-
# Other
185
185
-
discord-presence = config.programs.nixcord.enable;
186
186
-
wakatime = true;
187
187
-
};
188
207
};
189
208
190
209
userKeymaps = [
191
210
{
192
211
context = "Editor";
193
212
bindings = {
194
194
-
# This relies on autosave being active, as it overwrites the default file save keybinding
213
213
+
# This relies on autosave being active, as it overwrites the default file save keybinding, and is the only way to format the file at the moment.
195
214
ctrl-s = "editor::Format";
196
215
};
197
216
}
198
217
];
199
199
-
200
200
-
extraPackages =
201
201
-
with pkgs;
202
202
-
[
203
203
-
oxlint
204
204
-
oxfmt
205
205
-
]
206
206
-
++ lib.optionals cfg.enable-nix [
207
207
-
nixd
208
208
-
nixfmt
209
209
-
]
210
210
-
++ lib.optionals cfg.enable-python [
211
211
-
python3Packages.python-lsp-server
212
212
-
]
213
213
-
++ lib.optionals cfg.enable-php [
214
214
-
php
215
215
-
phpPackages.composer
216
216
-
pretty-php
217
217
-
intelephense
218
218
-
];
219
218
};
220
219
};
221
220
}