blob: fe2c444daabb7d217c00e1d4f251f8778f2eae21 (
plain)
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
|
{
config,
lib,
pkgs,
...
}:
let
inherit (lib)
mkOption
types
mkIf
optionals
;
cfg = config.nx.editors.vscode;
in
{
options.nx.editors.vscode = {
enable = mkOption {
description = "vscode editor";
type = types.bool;
default = false;
};
useVSCodium = mkOption {
description = "Use vscodium instead of vscode";
type = types.bool;
default = false;
};
theme = mkOption {
description = "Theme to use for vscode";
type = types.enum [
"minimal"
"dark"
"light"
];
default = "minimal";
};
langs = {
cmake = mkOption {
description = "enable cmake integration";
type = types.bool;
default = false;
};
docker = mkOption {
description = "enable docker integration";
type = types.bool;
default = false;
};
python = mkOption {
description = "enable python integration";
type = types.bool;
default = false;
};
go = mkOption {
description = "enable go integration";
type = types.bool;
default = false;
};
rust = mkOption {
description = "enable rust integration";
type = types.bool;
default = false;
};
java = mkOption {
description = "enable java integration";
type = types.bool;
default = false;
};
lua = mkOption {
description = "enable lua integration";
type = types.bool;
default = false;
};
tailwindcss = mkOption {
description = "enable tailwindcss integration";
type = types.bool;
default = false;
};
};
};
config = mkIf cfg.enable {
programs.vscode = {
enable = true;
package = if cfg.useVSCodium then pkgs.vscodium else pkgs.vscode;
mutableExtensionsDir = false;
profiles.default = {
enableUpdateCheck = true;
enableExtensionUpdateCheck = true;
userSettings = {
"update.mode" = "none";
"workbench.colorTheme" =
if cfg.theme == "minimal" then
"Minimal"
else if cfg.theme == "dark" then
"Default Dark Modern"
else
"Default Light Modern";
"editor.fontFamily" = "monospace";
"editor.tabSize" = 2;
"editor.minimap.enabled" = false;
"terminal.integrated.cursorStyle" = "underline";
"terminal.integrated.cursorStyleInactive" = "underline";
"terminal.integrated.fontFamily" = "monospace";
"terminal.integrated.fontSize" = 13;
"git.autofetch" = true;
"window.controlsStyle" = "custom";
};
extensions =
with pkgs.vscode-extensions;
[
github.copilot
adpyke.codesnap
esbenp.prettier-vscode
]
++ (optionals cfg.langs.cmake [ ms-vscode.cmake-tools ])
++ (optionals cfg.langs.docker [ ms-azuretools.vscode-docker ])
++ (optionals cfg.langs.python [ ms-python.python ])
++ (optionals cfg.langs.go [ golang.go ])
++ (optionals cfg.langs.rust [ rust-lang.rust-analyzer ])
++ (optionals cfg.langs.java [ vscjava.vscode-maven ])
++ (optionals cfg.langs.lua [ sumneko.lua ])
++ (optionals cfg.langs.tailwindcss [ bradlc.vscode-tailwindcss ])
++ (optionals (cfg.theme == "minimal") (
pkgs.vscode-utils.extensionsFromVscodeMarketplace [
{
name = "minimalist-dark";
publisher = "nichabosh";
version = "1.0.0";
sha256 = "sha256-lw+Scfada6DycLdRT2Cz+Fd12JucglIrw3uRd2ZhabQ=";
}
]
));
};
};
};
}
|