2024-08-25 09:45:58 +00:00
|
|
|
{
|
|
|
|
inputs,
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
2023-12-24 10:53:47 +00:00
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.custom-hm.vscode;
|
2024-04-16 07:53:02 +00:00
|
|
|
|
|
|
|
packages = {
|
|
|
|
nixPackages = {
|
2024-08-25 09:45:58 +00:00
|
|
|
systemPackages = with pkgs; [
|
|
|
|
nixd
|
|
|
|
nixpkgs-fmt
|
|
|
|
];
|
2024-04-16 07:53:02 +00:00
|
|
|
extension = with inputs.nix-vscode-extensions.extensions.${pkgs.system}.vscode-marketplace; [
|
|
|
|
jnoortheen.nix-ide
|
|
|
|
];
|
|
|
|
settings = {
|
|
|
|
"nix.enableLanguageServer" = true;
|
|
|
|
"nix.formatterPath" = "nixpkgs-fmt";
|
|
|
|
"nix.serverPath" = "nixd";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
cxxPackages = {
|
2024-08-25 09:45:58 +00:00
|
|
|
systemPackages = with pkgs; [
|
|
|
|
clang-tools
|
|
|
|
cmake-format
|
|
|
|
];
|
2024-04-16 07:53:02 +00:00
|
|
|
extension = with inputs.nix-vscode-extensions.extensions.${pkgs.system}.vscode-marketplace; [
|
|
|
|
llvm-vs-code-extensions.vscode-clangd
|
2024-08-25 09:45:58 +00:00
|
|
|
(ms-vscode.cmake-tools.overrideAttrs (_: {
|
|
|
|
sourceRoot = "extension";
|
|
|
|
}))
|
2024-04-16 07:53:02 +00:00
|
|
|
twxs.cmake
|
2024-06-11 10:02:55 +00:00
|
|
|
ms-vscode.cpptools
|
2024-04-16 07:53:02 +00:00
|
|
|
];
|
|
|
|
settings = {
|
|
|
|
"cmake.configureOnEdit" = false;
|
|
|
|
"cmake.showOptionsMovedNotification" = false;
|
|
|
|
"cmake.showNotAllDocumentsSavedQuestion" = false;
|
2024-07-14 06:04:52 +00:00
|
|
|
"cmake.pinnedCommands" = [
|
|
|
|
"workbench.action.tasks.configureTaskRunner"
|
|
|
|
"workbench.action.tasks.runTask"
|
2024-08-20 13:07:34 +00:00
|
|
|
];
|
2024-06-11 10:02:55 +00:00
|
|
|
"C_Cpp.intelliSenseEngine" = "Disabled";
|
2024-04-16 07:53:02 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
pythonPackages = {
|
|
|
|
systemPackages = with pkgs; [ ];
|
|
|
|
extension = with inputs.nix-vscode-extensions.extensions.${pkgs.system}.vscode-marketplace; [
|
|
|
|
ms-python.python
|
|
|
|
];
|
|
|
|
settings = { };
|
|
|
|
};
|
|
|
|
scalaPackages = {
|
2024-08-25 09:45:58 +00:00
|
|
|
systemPackages = with pkgs; [
|
|
|
|
coursier
|
|
|
|
metals
|
|
|
|
];
|
2024-04-16 07:53:02 +00:00
|
|
|
extension = with inputs.nix-vscode-extensions.extensions.${pkgs.system}.vscode-marketplace; [
|
|
|
|
scala-lang.scala
|
|
|
|
scalameta.metals
|
|
|
|
];
|
|
|
|
settings = { };
|
|
|
|
};
|
|
|
|
latexPackages = {
|
|
|
|
systemPackages = with pkgs; [ texliveSmall ];
|
|
|
|
extension = with inputs.nix-vscode-extensions.extensions.${pkgs.system}.vscode-marketplace; [
|
|
|
|
james-yu.latex-workshop
|
|
|
|
];
|
|
|
|
settings = {
|
|
|
|
"latex-workshop.latex.autoBuild.run" = "never";
|
|
|
|
"latex-workshop.latex.tools" = [
|
2024-08-20 13:07:34 +00:00
|
|
|
{
|
|
|
|
"name" = "xelatex";
|
2024-04-16 07:53:02 +00:00
|
|
|
"command" = "xelatex";
|
2024-08-25 09:45:58 +00:00
|
|
|
"args" = [
|
|
|
|
"-synctex=1"
|
|
|
|
"-interaction=nonstopmode"
|
|
|
|
"-file-line-error"
|
|
|
|
"%DOCFILE%"
|
|
|
|
];
|
2024-04-16 07:53:02 +00:00
|
|
|
}
|
2024-08-20 13:07:34 +00:00
|
|
|
{
|
|
|
|
"name" = "pdflatex";
|
2024-04-16 07:53:02 +00:00
|
|
|
"command" = "pdflatex";
|
2024-08-25 09:45:58 +00:00
|
|
|
"args" = [
|
|
|
|
"-synctex=1"
|
|
|
|
"-interaction=nonstopmode"
|
|
|
|
"-file-line-error"
|
|
|
|
"%DOCFILE%"
|
|
|
|
];
|
|
|
|
}
|
|
|
|
{
|
|
|
|
"name" = "bibtex";
|
|
|
|
"command" = "bibtex";
|
|
|
|
"args" = [ "%DOCFILE%" ];
|
2024-04-16 07:53:02 +00:00
|
|
|
}
|
|
|
|
];
|
|
|
|
"latex-workshop.latex.recipes" = [
|
2024-08-25 09:45:58 +00:00
|
|
|
{
|
|
|
|
"name" = "xelatex";
|
|
|
|
"tools" = [ "xelatex" ];
|
|
|
|
}
|
|
|
|
{
|
|
|
|
"name" = "pdflatex";
|
|
|
|
"tools" = [ "pdflatex" ];
|
|
|
|
}
|
|
|
|
{
|
|
|
|
"name" = "xe->bib->xe->xe";
|
|
|
|
"tools" = [
|
|
|
|
"xelatex"
|
|
|
|
"bibtex"
|
|
|
|
"xelatex"
|
|
|
|
"xelatex"
|
|
|
|
];
|
|
|
|
}
|
|
|
|
{
|
|
|
|
"name" = "pdf->bib->pdf->pdf";
|
|
|
|
"tools" = [
|
|
|
|
"pdflatex"
|
|
|
|
"bibtex"
|
|
|
|
"pdflatex"
|
|
|
|
"pdflatex"
|
|
|
|
];
|
|
|
|
}
|
2024-04-16 07:53:02 +00:00
|
|
|
];
|
|
|
|
"[latex]" = {
|
|
|
|
"editor.formatOnPaste" = false;
|
|
|
|
"editor.suggestSelection" = "recentlyusedbyprefix";
|
|
|
|
"editor.wordWrap" = "bounded";
|
|
|
|
"editor.wordWrapColumn" = 80;
|
|
|
|
"editor.unicodeHighlight.ambiguousCharacters" = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2024-08-20 13:07:34 +00:00
|
|
|
llmExtensions = [ pkgs.vscode-extensions.continue.continue ];
|
2024-04-16 07:53:02 +00:00
|
|
|
|
2024-08-25 09:45:58 +00:00
|
|
|
languages = [
|
|
|
|
"nix"
|
|
|
|
"cxx"
|
|
|
|
"python"
|
|
|
|
"scala"
|
|
|
|
"latex"
|
|
|
|
];
|
|
|
|
zipAttrsWithLanguageOption = (
|
|
|
|
attr: (map (l: (lib.mkIf cfg.languages.${l} packages."${l}Packages".${attr})) languages)
|
2024-04-16 07:53:02 +00:00
|
|
|
);
|
2023-12-24 10:53:47 +00:00
|
|
|
in
|
|
|
|
{
|
2024-01-13 02:47:37 +00:00
|
|
|
options.custom-hm.vscode = {
|
2023-12-24 10:53:47 +00:00
|
|
|
enable = mkEnableOption "Vscode config";
|
2024-04-16 07:53:02 +00:00
|
|
|
languages = {
|
|
|
|
nix = mkOption {
|
|
|
|
type = lib.types.bool;
|
|
|
|
default = true;
|
|
|
|
};
|
|
|
|
cxx = mkEnableOption "C++";
|
|
|
|
python = mkEnableOption "Python";
|
|
|
|
scala = mkEnableOption "Scala";
|
|
|
|
latex = mkEnableOption "Latex";
|
|
|
|
};
|
2024-08-20 13:07:34 +00:00
|
|
|
llm = mkEnableOption "tab completion with Continue and ollama";
|
2023-12-24 10:53:47 +00:00
|
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
2024-07-15 02:54:25 +00:00
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
|
2024-08-25 09:45:58 +00:00
|
|
|
home.packages = lib.mkMerge (
|
|
|
|
[
|
|
|
|
[ pkgs.clang-tools ]
|
|
|
|
(mkIf cfg.llm [ pkgs.ollama ])
|
|
|
|
]
|
|
|
|
++ zipAttrsWithLanguageOption "systemPackages"
|
|
|
|
);
|
2023-12-24 10:53:47 +00:00
|
|
|
programs.vscode = {
|
|
|
|
enable = true;
|
2024-06-11 10:02:55 +00:00
|
|
|
package = pkgs.vscode.override { commandLineArgs = "--enable-wayland-ime"; };
|
2023-12-24 10:53:47 +00:00
|
|
|
enableUpdateCheck = false;
|
|
|
|
enableExtensionUpdateCheck = false;
|
|
|
|
mutableExtensionsDir = false;
|
2024-08-25 09:45:58 +00:00
|
|
|
extensions = lib.mkMerge (
|
|
|
|
[
|
|
|
|
(with inputs.nix-vscode-extensions.extensions.${pkgs.system}.vscode-marketplace; [
|
|
|
|
mkhl.direnv
|
2023-12-24 10:53:47 +00:00
|
|
|
|
2024-08-25 09:45:58 +00:00
|
|
|
ms-azuretools.vscode-docker
|
|
|
|
ms-vscode-remote.remote-ssh
|
|
|
|
vscodevim.vim
|
|
|
|
github.vscode-pull-request-github
|
|
|
|
gruntfuggly.todo-tree # todo highlight
|
2024-03-25 08:26:48 +00:00
|
|
|
|
2024-08-25 09:45:58 +00:00
|
|
|
# Markdown
|
|
|
|
davidanson.vscode-markdownlint
|
|
|
|
# Latex
|
|
|
|
# Scale / chisel
|
|
|
|
sterben.fpga-support
|
2023-12-24 10:53:47 +00:00
|
|
|
|
2024-08-25 09:45:58 +00:00
|
|
|
ms-vscode-remote.remote-ssh-edit
|
|
|
|
mushan.vscode-paste-image
|
|
|
|
])
|
2024-08-20 13:07:34 +00:00
|
|
|
|
2024-08-25 09:45:58 +00:00
|
|
|
(with pkgs.vscode-extensions; [
|
|
|
|
waderyan.gitblame
|
|
|
|
catppuccin.catppuccin-vsc
|
|
|
|
# Rust
|
|
|
|
rust-lang.rust-analyzer
|
|
|
|
])
|
2024-08-20 13:07:34 +00:00
|
|
|
|
2024-08-25 09:45:58 +00:00
|
|
|
(mkIf cfg.llm llmExtensions)
|
|
|
|
]
|
|
|
|
++ zipAttrsWithLanguageOption "extension"
|
|
|
|
);
|
|
|
|
userSettings = lib.mkMerge (
|
|
|
|
[
|
|
|
|
{
|
|
|
|
"workbench.colorTheme" = "Catppuccin Macchiato";
|
|
|
|
"terminal.integrated.sendKeybindingsToShell" = true;
|
|
|
|
"extensions.ignoreRecommendations" = true;
|
|
|
|
"files.autoSave" = "afterDelay";
|
|
|
|
"editor.inlineSuggest.enabled" = true;
|
|
|
|
"editor.rulers" = [ 80 ];
|
|
|
|
"editor.mouseWheelZoom" = true;
|
|
|
|
"git.autofetch" = false;
|
|
|
|
"window.zoomLevel" = -1;
|
2023-12-24 10:53:47 +00:00
|
|
|
|
2024-08-25 09:45:58 +00:00
|
|
|
"extensions.experimental.affinity" = {
|
|
|
|
"vscodevim.vim" = 1;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
]
|
|
|
|
++ zipAttrsWithLanguageOption "settings"
|
|
|
|
);
|
2024-08-20 13:07:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
home.file.".continue/config.json".text = lib.generators.toJSON { } {
|
|
|
|
models = [
|
|
|
|
{
|
|
|
|
model = "AUTODETECT";
|
|
|
|
provider = "ollama";
|
|
|
|
title = "Ollama";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
tabAutocompleteModel = {
|
2024-08-25 09:45:58 +00:00
|
|
|
model = "deepseek-coder:6.7b-base";
|
2024-08-20 13:07:34 +00:00
|
|
|
provider = "ollama";
|
|
|
|
title = "codegemma";
|
|
|
|
};
|
2023-12-24 10:53:47 +00:00
|
|
|
};
|
|
|
|
};
|
2024-08-20 13:07:34 +00:00
|
|
|
|
2023-12-24 10:53:47 +00:00
|
|
|
}
|