diff --git a/modules/home/vscode.nix b/modules/home/vscode.nix index 179449b..9a4ec89 100644 --- a/modules/home/vscode.nix +++ b/modules/home/vscode.nix @@ -8,7 +8,8 @@ let rustBindgenExtraClangArgs = lib.concatStringsSep " " ( (builtins.map (a: ''-I"${a}/include"'') [ pkgs.glibc.dev - ]) ++ [ + ]) + ++ [ ''-I"${pkgs.llvmPackages_latest.libclang.lib}/lib/clang/${pkgs.llvmPackages_latest.libclang.version}/include"'' ''-I"${pkgs.glib.dev}/include/glib-2.0"'' ''-I${pkgs.glib.out}/lib/glib-2.0/include/'' @@ -17,27 +18,35 @@ let layers = rec { common = { - extensions = (with vsc; [ - github.copilot - github.copilot-chat - dracula-theme.theme-dracula - ms-vscode-remote.vscode-remote-extensionpack - dbaeumer.vscode-eslint - ms-vscode-remote.remote-containers - ms-vscode-remote.remote-ssh - github.vscode-github-actions - github.vscode-pull-request-github - eamodio.gitlens - streetsidesoftware.code-spell-checker - ms-ceintl.vscode-language-pack-ja - ]) ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ - { - name = "hadolint"; - publisher = "exiasr"; - version = "1.1.2"; - hash = "sha256-6GO1f8SP4CE8yYl87/tm60FdGHqHsJA4c2B6UKVdpgM="; - } - ]; + extensions = + (with vsc; [ + github.copilot + github.copilot-chat + dracula-theme.theme-dracula + ms-vscode-remote.vscode-remote-extensionpack + dbaeumer.vscode-eslint + ms-vscode-remote.remote-containers + ms-vscode-remote.remote-ssh + github.vscode-github-actions + github.vscode-pull-request-github + eamodio.gitlens + streetsidesoftware.code-spell-checker + ms-ceintl.vscode-language-pack-ja + ]) + ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ + { + name = "hadolint"; + publisher = "exiasr"; + version = "1.1.2"; + hash = "sha256-6GO1f8SP4CE8yYl87/tm60FdGHqHsJA4c2B6UKVdpgM="; + } + { + name = "chatgpt"; + publisher = "openai"; + version = "0.4.71"; + hash = "sha256-Q0le5rhVRgTDQXjIlhbzJOv/7+xC6JXwTp6fxZCP4ak="; + } + ]; userSettings = { "workbench.colorTheme" = "Dracula"; "window.autoDetectColorScheme" = false; @@ -48,40 +57,46 @@ let "git.confirmSync" = false; "github.copilot.nextEditSuggestions.enabled" = true; "editor.suggestOnTriggerCharacters" = true; - "editor.quickSuggestions" = { other = true; comments = false; strings = true; }; + "editor.quickSuggestions" = { + other = true; + comments = false; + strings = true; + }; "git.autofetch" = true; "workbench.editor.enablePreview" = false; }; }; web = { - extensions = (with vsc; [ - biomejs.biome - lokalise.i18n-ally - bradlc.vscode-tailwindcss - prisma.prisma - hashicorp.terraform - yoavbls.pretty-ts-errors - ]) ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ - { - name = "pnpm-catalog-lens"; - publisher = "antfu"; - version = "1.0.0"; - hash = "sha256-mCMBVxZRIb3Jao1XSS7EQRQX3Y2vrkpAmy6ldSqZa9c="; - } - { - name = "explorer"; - publisher = "vitest"; - version = "1.32.1"; - hash = "sha256-MAfjS/oFfFuiE+Q2w6leSlao436QSw2fKjd7/BE/Q8Y="; - } - { - name = "native-preview"; - publisher = "typescriptteam"; - version = "0.20251104.1"; - hash = "sha256-lUSwtf7jncnrp6UXgmZU30e+CFRKqf0N41+Xna6daok="; - } - ]; + extensions = + (with vsc; [ + biomejs.biome + lokalise.i18n-ally + bradlc.vscode-tailwindcss + prisma.prisma + hashicorp.terraform + yoavbls.pretty-ts-errors + ]) + ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ + { + name = "pnpm-catalog-lens"; + publisher = "antfu"; + version = "1.0.0"; + hash = "sha256-mCMBVxZRIb3Jao1XSS7EQRQX3Y2vrkpAmy6ldSqZa9c="; + } + { + name = "explorer"; + publisher = "vitest"; + version = "1.32.1"; + hash = "sha256-MAfjS/oFfFuiE+Q2w6leSlao436QSw2fKjd7/BE/Q8Y="; + } + { + name = "native-preview"; + publisher = "typescriptteam"; + version = "0.20251104.1"; + hash = "sha256-lUSwtf7jncnrp6UXgmZU30e+CFRKqf0N41+Xna6daok="; + } + ]; userSettings = { "editor.defaultFormatter" = "biomejs.biome"; "[typescript].editor.defaultFormatter" = "biomejs.biome"; @@ -97,7 +112,7 @@ let userSettings = { "nix.enableLanguageServer" = true; "nix.serverPath" = "nil"; - "[nix]"={ + "[nix]" = { "editor.defaultFormatter" = "jnoortheen.nix-ide"; }; }; @@ -108,16 +123,19 @@ let ms-toolsai.jupyter ms-python.python ]; - userSettings = {}; + userSettings = { }; }; java = { - extensions = (with vsc; [ - vscjava.vscode-java-pack - sonarsource.sonarlint-vscode - vscjava.vscode-java-debug - redhat.java - ]); + extensions = ( + with vsc; + [ + vscjava.vscode-java-pack + sonarsource.sonarlint-vscode + vscjava.vscode-java-debug + redhat.java + ] + ); userSettings = { "java.jdt.ls.java.home" = "${pkgs.jdk25.home}"; @@ -185,28 +203,43 @@ let "rust-analyzer.lens.references.method.enable" = true; "rust-analyzer.lens.references.trait.enable" = true; - "files.watcherExclude" = { "**/target/**" = true; }; - "search.exclude" = { "**/target/**" = true; }; + "files.watcherExclude" = { + "**/target/**" = true; + }; + "search.exclude" = { + "**/target/**" = true; + }; }; }; }; - combine = (ls: - builtins.foldl' (acc: l: { - extensions = acc.extensions ++ (l.extensions or []); - userSettings = recursiveUpdate acc.userSettings (l.userSettings or {}); - }) { extensions = []; userSettings = {}; } ls + combine = ( + ls: + builtins.foldl' + (acc: l: { + extensions = acc.extensions ++ (l.extensions or [ ]); + userSettings = recursiveUpdate acc.userSettings (l.userSettings or { }); + }) + { + extensions = [ ]; + userSettings = { }; + } + ls ); # mkProfile [layers...] { extensions = [...]; userSettings = { ... }; } - mkProfile = layersList: extras: - let base = combine layersList; - in { - extensions = base.extensions ++ (extras.extensions or []); - userSettings = recursiveUpdate base.userSettings (extras.userSettings or {}); + mkProfile = + layersList: extras: + let + base = combine layersList; + in + { + extensions = base.extensions ++ (extras.extensions or [ ]); + userSettings = recursiveUpdate base.userSettings (extras.userSettings or { }); }; -in { +in +{ nixpkgs.config.allowUnfree = true; programs.vscode = { @@ -228,8 +261,8 @@ in { }; xdg.configFile."Code/User/locale.json".text = '' - { - "locale": "ja" - } + { + "locale": "ja" + } ''; }