From f08b45d2bc478b436f41683473db72d89da5d9d0 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Sat, 29 Aug 2026 17:05:44 +0800 Subject: [PATCH] feat(editors): restore vscode alongside zed for build123d workflows - linux: programs.vscode via pkgs-master with gnome-libsecret password store - darwin: visual-studio-code cask + aerospace window rules - idols-ai: persist .vscode and .config/Code (Settings Sync handles extensions) - xdg: code.desktop editor association and vscode:// scheme handler --- home/darwin/aerospace/aerospace.toml | 4 ++++ home/linux/gui/base/vscode.nix | 21 +++++++++++++++++++++ home/linux/gui/base/xdg/mime.nix | 3 +++ hosts/idols-ai/preservation.nix | 4 ++++ modules/darwin/apps.nix | 3 +++ 5 files changed, 35 insertions(+) create mode 100644 home/linux/gui/base/vscode.nix diff --git a/home/darwin/aerospace/aerospace.toml b/home/darwin/aerospace/aerospace.toml index a530f526..56ecd60e 100644 --- a/home/darwin/aerospace/aerospace.toml +++ b/home/darwin/aerospace/aerospace.toml @@ -280,6 +280,10 @@ run = ['layout floating', 'move-node-to-workspace 9File'] if.app-id = 'com.apple.Preview' run = ['layout floating', 'move-node-to-workspace 9File'] +[[on-window-detected]] +if.app-id = 'com.microsoft.VSCode' +run = ['layout floating', 'move-node-to-workspace 9File'] + [[on-window-detected]] if.app-id = 'com.todesktop.230313mzl4w4u92' # Cursor AI Editor run = ['layout floating', 'move-node-to-workspace 9File'] diff --git a/home/linux/gui/base/vscode.nix b/home/linux/gui/base/vscode.nix new file mode 100644 index 00000000..64e2469e --- /dev/null +++ b/home/linux/gui/base/vscode.nix @@ -0,0 +1,21 @@ +{ + lib, + pkgs-master, + ... +}: + +{ + programs.vscode = { + # Extensions and settings are managed by VS Code's built-in Settings Sync, + # not declaratively here (persisted via `.config/Code`, see preservation). + enable = true; + package = pkgs-master.vscode.override { + commandLineArgs = [ + # https://code.visualstudio.com/docs/configure/settings-sync#_recommended-configure-the-keyring-to-use-with-vs-code + # For use with any package that implements the Secret Service API + # (for example gnome-keyring, kwallet5, KeepassXC) + "--password-store=gnome-libsecret" + ]; + }; + }; +} diff --git a/home/linux/gui/base/xdg/mime.nix b/home/linux/gui/base/xdg/mime.nix index e48d566c..ee8b47fd 100644 --- a/home/linux/gui/base/xdg/mime.nix +++ b/home/linux/gui/base/xdg/mime.nix @@ -18,6 +18,7 @@ "firefox.desktop" ]; editor = [ + "code.desktop" "dev.zed.Zed.desktop" "nvim.desktop" "Helix.desktop" @@ -47,6 +48,8 @@ "x-scheme-handler/ftp" = browser; # open `ftp:` url with `browser` "x-scheme-handler/http" = browser; "x-scheme-handler/https" = browser; + # https://github.com/microsoft/vscode/issues/146408 + "x-scheme-handler/vscode" = [ "code-url-handler.desktop" ]; # open `vscode://` url with `code-url-handler.desktop` "x-scheme-handler/zoommtg" = [ "Zoom.desktop" ]; # all other unknown schemes will be opened by this default application. diff --git a/hosts/idols-ai/preservation.nix b/hosts/idols-ai/preservation.nix index c1256878..727d504d 100644 --- a/hosts/idols-ai/preservation.nix +++ b/hosts/idols-ai/preservation.nix @@ -141,6 +141,10 @@ in # neovim plugins ".wakatime" + # vscode + ".vscode" + ".config/Code" + # zed ".config/zed" ".local/share/zed" diff --git a/modules/darwin/apps.nix b/modules/darwin/apps.nix index db858b39..63399633 100644 --- a/modules/darwin/apps.nix +++ b/modules/darwin/apps.nix @@ -153,6 +153,9 @@ in # "nikitabobko/tap/aerospace" # an i3-like tiling window manager for macOS "ghostty" # terminal emulator + # code editor + "visual-studio-code" + # AI agents "codex-app" # codex desktop app "claude" # claude desktop app