2023-12-17 12:12:31 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
userCfg = config.users.foo-dogsquared;
|
|
|
|
cfg = userCfg.programs.vs-code;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.users.foo-dogsquared.programs.vs-code.enable =
|
|
|
|
lib.mkEnableOption "foo-dogsquared's Visual Studio Code setup";
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
2024-07-11 10:11:56 +00:00
|
|
|
suites.editors.vscode.enable = true;
|
2023-12-17 12:12:31 +00:00
|
|
|
programs.vscode = {
|
2024-07-11 10:11:56 +00:00
|
|
|
extensions = with pkgs.vscode-extensions; [
|
2023-12-17 12:12:31 +00:00
|
|
|
# Additional language support.
|
|
|
|
bbenoist.nix
|
|
|
|
graphql.vscode-graphql
|
2024-12-12 02:11:45 +00:00
|
|
|
ms-python.python
|
|
|
|
ms-azuretools.vscode-docker
|
2023-12-17 12:12:31 +00:00
|
|
|
ms-vscode.cmake-tools
|
|
|
|
ms-vscode.cpptools
|
|
|
|
ms-vscode.powershell
|
|
|
|
|
|
|
|
# Extra editor niceties.
|
|
|
|
eamodio.gitlens
|
|
|
|
mkhl.direnv
|
|
|
|
usernamehw.errorlens
|
|
|
|
vadimcn.vscode-lldb
|
|
|
|
|
|
|
|
# The other niceties.
|
|
|
|
editorconfig.editorconfig
|
2024-12-12 02:11:45 +00:00
|
|
|
alefragnani.project-manager
|
|
|
|
fill-labs.dependi
|
|
|
|
]
|
|
|
|
++ lib.optionals userCfg.programs.browsers.firefox.enable [
|
|
|
|
firefox-devtools.vscode-firefox-debug
|
|
|
|
];
|
2023-12-17 12:12:31 +00:00
|
|
|
|
2023-12-19 10:00:22 +00:00
|
|
|
userSettings = {
|
2023-12-17 12:12:31 +00:00
|
|
|
"extensions.ignoreRecommendations" = true;
|
|
|
|
};
|
|
|
|
};
|
2024-11-19 12:24:41 +00:00
|
|
|
|
|
|
|
# We're using Visual Studio Code as a git difftool and mergetool which is
|
|
|
|
# surprisingly good compared to the competition (which is not much).
|
|
|
|
programs.git.extraConfig = {
|
|
|
|
diff.tool = lib.mkDefault "vscode";
|
|
|
|
difftool.vscode.cmd = "code --wait --diff $LOCAL $REMOTE";
|
|
|
|
|
|
|
|
# It has a three-way merge.
|
|
|
|
merge.tool = lib.mkDefault "vscode";
|
|
|
|
mergetool.vscode.cmd = "code --wait --merge $REMOTE $LOCAL $BASE $MERGED";
|
|
|
|
};
|
2023-12-17 12:12:31 +00:00
|
|
|
};
|
|
|
|
}
|