2022-10-26 17:29:56 +00:00
|
|
|
{pkgs, config, lib, ... }:
|
|
|
|
|
2023-04-27 11:57:24 +00:00
|
|
|
with config.stylix.fonts;
|
|
|
|
|
2022-10-26 17:29:56 +00:00
|
|
|
let
|
|
|
|
themeFile = config.lib.stylix.colors {
|
2023-07-14 11:50:08 +00:00
|
|
|
template = ./template.mustache;
|
2022-10-26 17:29:56 +00:00
|
|
|
extension = ".json";
|
|
|
|
};
|
|
|
|
|
2023-04-19 08:33:49 +00:00
|
|
|
themeExtension = pkgs.runCommandLocal "stylix-vscode" {
|
|
|
|
vscodeExtUniqueId = "stylix.stylix";
|
|
|
|
vscodeExtPublisher = "stylix";
|
2022-10-26 17:29:56 +00:00
|
|
|
version = "0.0.0";
|
2023-04-19 08:33:49 +00:00
|
|
|
} ''
|
|
|
|
mkdir -p "$out/share/vscode/extensions/$vscodeExtUniqueId/themes"
|
|
|
|
ln -s ${./package.json} "$out/share/vscode/extensions/$vscodeExtUniqueId/package.json"
|
|
|
|
ln -s ${themeFile} "$out/share/vscode/extensions/$vscodeExtUniqueId/themes/stylix.json"
|
2022-10-26 17:29:56 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
in {
|
|
|
|
options.stylix.targets.vscode.enable =
|
|
|
|
config.lib.stylix.mkEnableTarget "VSCode" true;
|
|
|
|
|
2024-06-10 09:52:47 +00:00
|
|
|
config = lib.mkIf (config.stylix.enable && config.stylix.targets.vscode.enable) {
|
2023-01-30 21:56:57 +00:00
|
|
|
programs.vscode = {
|
|
|
|
extensions = [ themeExtension ];
|
2023-04-27 11:57:24 +00:00
|
|
|
userSettings = {
|
2024-01-17 13:11:23 +00:00
|
|
|
"workbench.colorTheme" = "Stylix";
|
|
|
|
"terminal.integrated.fontFamily" = "'${monospace.name}'";
|
|
|
|
"editor.fontFamily" = "'${monospace.name}'";
|
2023-04-27 11:57:24 +00:00
|
|
|
};
|
2023-01-30 21:56:57 +00:00
|
|
|
};
|
2022-10-26 17:29:56 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|