-
Notifications
You must be signed in to change notification settings - Fork 0
fix: init #423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: init #423
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,14 +1,17 @@ | ||||||||||
| { pkgs, ... }: | ||||||||||
| let | ||||||||||
| inherit (pkgs) lib; | ||||||||||
| in | ||||||||||
| { | ||||||||||
| launchd.agents.code-syncer = pkgs.lib.mkIf pkgs.stdenv.isDarwin { | ||||||||||
| launchd.agents.code-syncer = lib.mkIf pkgs.stdenv.isDarwin { | ||||||||||
| enable = true; | ||||||||||
| config = { | ||||||||||
| ProgramArguments = [ | ||||||||||
| "${pkgs.bash}/bin/bash" | ||||||||||
| "${./sync.sh}" | ||||||||||
| ]; | ||||||||||
| Environment = { | ||||||||||
| PATH = "${pkgs.lib.makeBinPath [ | ||||||||||
| PATH = "${lib.makeBinPath [ | ||||||||||
| pkgs.fswatch | ||||||||||
| ]}"; | ||||||||||
| }; | ||||||||||
|
|
@@ -18,4 +21,26 @@ | |||||||||
| StandardErrorPath = "/tmp/code-syncer.error.log"; | ||||||||||
| }; | ||||||||||
| }; | ||||||||||
|
|
||||||||||
| systemd.user.services.code-syncer = lib.mkIf pkgs.stdenv.isLinux { | ||||||||||
| Unit = { | ||||||||||
| Description = "VS Code settings syncer"; | ||||||||||
| }; | ||||||||||
| Service = { | ||||||||||
| Type = "simple"; | ||||||||||
| Environment = "PATH=${ | ||||||||||
| lib.makeBinPath [ | ||||||||||
| pkgs.bash | ||||||||||
| pkgs.coreutils | ||||||||||
| pkgs.inotify-tools | ||||||||||
|
||||||||||
| pkgs.inotify-tools | |
| pkgs.inotify-tools | |
| pkgs.gnused | |
| pkgs.gnugrep |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -3,12 +3,24 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # --- CONFIGURATION --- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Base directories | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VSCODE_USER_DIR="$HOME/Library/Application Support/Code/User" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VSCODE_INSIDERS_USER_DIR="$HOME/Library/Application Support/Code - Insiders/User" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ANTIGRAVITY_USER_DIR="$HOME/Library/Application Support/Antigravity/User" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CURSOR_USER_DIR="$HOME/Library/Application Support/Cursor/User" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| WINDSURF_USER_DIR="$HOME/Library/Application Support/Windsurf/User" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Detect OS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| OS_TYPE="$(uname -s)" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Base directories (OS-specific) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ "$OS_TYPE" = "Darwin" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VSCODE_USER_DIR="$HOME/Library/Application Support/Code/User" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VSCODE_INSIDERS_USER_DIR="$HOME/Library/Application Support/Code - Insiders/User" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ANTIGRAVITY_USER_DIR="$HOME/Library/Application Support/Antigravity/User" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CURSOR_USER_DIR="$HOME/Library/Application Support/Cursor/User" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| WINDSURF_USER_DIR="$HOME/Library/Application Support/Windsurf/User" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Linux/Other | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VSCODE_USER_DIR="$HOME/.config/Code/User" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VSCODE_INSIDERS_USER_DIR="$HOME/.config/Code - Insiders/User" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ANTIGRAVITY_USER_DIR="$HOME/.config/Antigravity/User" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CURSOR_USER_DIR="$HOME/.config/Cursor/User" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| WINDSURF_USER_DIR="$HOME/.config/Windsurf/User" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+10
to
+23
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's a lot of repetition in defining the base directories for different operating systems. You can reduce this by defining a single base path variable depending on the OS and then constructing the full paths from it. This will make the script easier to maintain if you need to add more application paths in the future.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Files | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SETTINGS_FILE="settings.json" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -94,14 +106,21 @@ clean_extension_list() { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| cp "$input_source" "$clean_file" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Use appropriate sed syntax for OS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ "$OS_TYPE" = "Darwin" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SED_INPLACE="sed -i ''" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1: Storing if [ "$OS_TYPE" = "Darwin" ]; then
SED_INPLACE=(sed -i '')
else
SED_INPLACE=(sed -i)
fiThen invoke with Prompt for AI agentsThen invoke with
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SED_INPLACE="sed -i" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+110
to
+114
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for bad_ext in "${PROPRIETARY_EXTENSIONS[@]}"; do | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Remove the line containing the bad extension | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sed -i '' "/$bad_ext/d" "$clean_file" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $SED_INPLACE "/$bad_ext/d" "$clean_file" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| done | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for ai_ext in "${AI_EXTENSIONS[@]}"; do | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Remove the line containing the AI extension | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sed -i '' "/$ai_ext/d" "$clean_file" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $SED_INPLACE "/$ai_ext/d" "$clean_file" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| done | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
116
to
124
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These two loops can be combined into one by first merging the two arrays of extensions. This improves readability and reduces code duplication. While the performance impact of multiple
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -394,14 +413,29 @@ install_extensions "windsurf" | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Initial Sync Complete." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # 4. Watcher (Mac only) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if command -v fswatch >/dev/null; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Watching for changes in VS Code settings..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fswatch -o "$VSCODE_USER_DIR/$SETTINGS_FILE" "$VSCODE_USER_DIR/$KEYBINDINGS_FILE" | while read num; do | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sync_config_file "$SETTINGS_FILE" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sync_config_file "$KEYBINDINGS_FILE" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Updated at $(date)" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| done | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # 4. Watcher (OS-specific) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ "$OS_TYPE" = "Darwin" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # macOS: use fswatch | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if command -v fswatch >/dev/null; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Watching for changes in VS Code settings (macOS)..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fswatch -o "$VSCODE_USER_DIR/$SETTINGS_FILE" "$VSCODE_USER_DIR/$KEYBINDINGS_FILE" | while read num; do | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sync_config_file "$SETTINGS_FILE" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sync_config_file "$KEYBINDINGS_FILE" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Updated at $(date)" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| done | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "fswatch not found. Auto-sync disabled." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "fswatch not found. Auto-sync disabled." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Linux: use inotifywait | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if command -v inotifywait >/dev/null; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Watching for changes in VS Code settings (Linux)..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| inotifywait -m -e modify,create "$VSCODE_USER_DIR/$SETTINGS_FILE" "$VSCODE_USER_DIR/$KEYBINDINGS_FILE" 2>/dev/null | while read -r directory events filename; do | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sync_config_file "$SETTINGS_FILE" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sync_config_file "$KEYBINDINGS_FILE" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Updated at $(date)" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+433
to
+436
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| inotifywait -m -e modify,create "$VSCODE_USER_DIR/$SETTINGS_FILE" "$VSCODE_USER_DIR/$KEYBINDINGS_FILE" 2>/dev/null | while read -r directory events filename; do | |
| sync_config_file "$SETTINGS_FILE" | |
| sync_config_file "$KEYBINDINGS_FILE" | |
| echo "Updated at $(date)" | |
| inotifywait -m -e modify,create "$VSCODE_USER_DIR" 2>/dev/null | while read -r directory events filename; do | |
| if [ "$filename" = "$SETTINGS_FILE" ]; then | |
| sync_config_file "$SETTINGS_FILE" | |
| fi | |
| if [ "$filename" = "$KEYBINDINGS_FILE" ]; then | |
| sync_config_file "$KEYBINDINGS_FILE" | |
| fi | |
| if [ "$filename" = "$SETTINGS_FILE" ] || [ "$filename" = "$KEYBINDINGS_FILE" ]; then | |
| echo "Updated at $(date)" | |
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The watcher logic currently re-syncs both settings.json and keybindings.json regardless of which one actually changed. Both fswatch and inotifywait can report the specific file that triggered the event. By using this information, you can make the sync more efficient by only processing the file that was modified.
For fswatch, you can remove the -o flag to get file paths. For inotifywait, the filename is already available in the while loop.
if [ "$OS_TYPE" = "Darwin" ]; then
# macOS: use fswatch
if command -v fswatch >/dev/null; then
echo "Watching for changes in VS Code settings (macOS)..."
fswatch "$VSCODE_USER_DIR/$SETTINGS_FILE" "$VSCODE_USER_DIR/$KEYBINDINGS_FILE" | while read -r path; do
filename=$(basename "$path")
sync_config_file "$filename"
echo "Updated at $(date)"
done
else
echo "fswatch not found. Auto-sync disabled."
fi
else
# Linux: use inotifywait
if command -v inotifywait >/dev/null; then
echo "Watching for changes in VS Code settings (Linux)..."
inotifywait -m -e modify,create "$VSCODE_USER_DIR/$SETTINGS_FILE" "$VSCODE_USER_DIR/$KEYBINDINGS_FILE" 2>/dev/null | while read -r directory events filename; do
if [ -n "$filename" ]; then
sync_config_file "$filename"
echo "Updated at $(date)"
fi
done
else
echo "inotifywait not found. Auto-sync disabled."
fi
fi| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,12 +38,16 @@ in | |
| Type = "oneshot"; | ||
| Environment = "PATH=${ | ||
| lib.makeBinPath [ | ||
| pkgs.git | ||
| pkgs.bash | ||
| pkgs.coreutils | ||
| pkgs.gnumake | ||
| pkgs.curl | ||
| pkgs.gawk | ||
| pkgs.git | ||
| pkgs.gnumake | ||
| pkgs.gnused | ||
| pkgs.nix | ||
| pkgs.sudo | ||
| pkgs.which | ||
| ] | ||
| }"; | ||
|
Comment on lines
39
to
52
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: fd -type f -name "update.sh" home-manager/services/dotfiles-updater/Repository: shunkakinoki/dotfiles Length of output: 235 🏁 Script executed: fd --type f "update.sh" home-manager/services/dotfiles-updater/Repository: shunkakinoki/dotfiles Length of output: 113 🏁 Script executed: cat -n home-manager/services/dotfiles-updater/update.shRepository: shunkakinoki/dotfiles Length of output: 536 🏁 Script executed: fd --type f "install.sh" home-manager/services/dotfiles-updater/Repository: shunkakinoki/dotfiles Length of output: 47 🏁 Script executed: fd --type f "install.sh"Repository: shunkakinoki/dotfiles Length of output: 75 🏁 Script executed: wc -l install.sh && head -100 install.shRepository: shunkakinoki/dotfiles Length of output: 3808 🏁 Script executed: tail -60 install.sh && echo "---" && rg -n "sudo" install.shRepository: shunkakinoki/dotfiles Length of output: 2186 🏁 Script executed: cat -n home-manager/services/dotfiles-updater/default.nix | head -60Repository: shunkakinoki/dotfiles Length of output: 1827 Remove The |
||
| ExecStart = "${./update.sh}"; | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -134,8 +134,8 @@ home-manager.lib.homeManagerConfiguration { | |||||||||
| enable = true; | ||||||||||
| enableSshSupport = false; | ||||||||||
| pinentry.package = pkgs.pinentry-tty; | ||||||||||
| defaultCacheTtl = 1800; | ||||||||||
| maxCacheTtl = 7200; | ||||||||||
| defaultCacheTtl = 94608000; # 3 years | ||||||||||
| maxCacheTtl = 94608000; # 3 years | ||||||||||
|
Comment on lines
+137
to
+138
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Setting the GPG agent cache TTL to 3 years (
Comment on lines
+137
to
+138
|
||||||||||
| defaultCacheTtl = 94608000; # 3 years | |
| maxCacheTtl = 94608000; # 3 years | |
| defaultCacheTtl = 600; # 10 minutes | |
| maxCacheTtl = 7200; # 2 hours |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,11 +7,20 @@ SCRIPT="$PWD/home-manager/services/code-syncer/sync.sh" | |
| Describe 'VS Code CLI detection' | ||
| setup() { | ||
| TEMP_HOME=$(mktemp -d) | ||
| mkdir -p "$TEMP_HOME/Library/Application Support/Code/User" | ||
| mkdir -p "$TEMP_HOME/Library/Application Support/Cursor/User" | ||
| mkdir -p "$TEMP_HOME/Library/Application Support/Windsurf/User" | ||
| mkdir -p "$TEMP_HOME/Library/Application Support/Antigravity/User" | ||
| mkdir -p "$TEMP_HOME/Library/Application Support/Code - Insiders/User" | ||
| OS_TYPE="$(uname -s)" | ||
| if [ "$OS_TYPE" = "Darwin" ]; then | ||
| mkdir -p "$TEMP_HOME/Library/Application Support/Code/User" | ||
| mkdir -p "$TEMP_HOME/Library/Application Support/Cursor/User" | ||
| mkdir -p "$TEMP_HOME/Library/Application Support/Windsurf/User" | ||
| mkdir -p "$TEMP_HOME/Library/Application Support/Antigravity/User" | ||
| mkdir -p "$TEMP_HOME/Library/Application Support/Code - Insiders/User" | ||
| else | ||
| mkdir -p "$TEMP_HOME/.config/Code/User" | ||
| mkdir -p "$TEMP_HOME/.config/Cursor/User" | ||
| mkdir -p "$TEMP_HOME/.config/Windsurf/User" | ||
| mkdir -p "$TEMP_HOME/.config/Antigravity/User" | ||
| mkdir -p "$TEMP_HOME/.config/Code - Insiders/User" | ||
| fi | ||
| } | ||
|
Comment on lines
8
to
24
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The directory creation logic inside this For example, you could define a function like |
||
|
|
||
| cleanup() { | ||
|
|
@@ -30,15 +39,24 @@ End | |
|
|
||
| Describe 'extension filtering' | ||
| setup() { | ||
| mock_bin_setup code fswatch | ||
| mock_bin_setup code fswatch inotifywait | ||
| TEMP_HOME=$(mktemp -d) | ||
|
|
||
| # Create required directories | ||
| mkdir -p "$TEMP_HOME/Library/Application Support/Code/User" | ||
| mkdir -p "$TEMP_HOME/Library/Application Support/Cursor/User" | ||
| mkdir -p "$TEMP_HOME/Library/Application Support/Windsurf/User" | ||
| mkdir -p "$TEMP_HOME/Library/Application Support/Antigravity/User" | ||
| mkdir -p "$TEMP_HOME/Library/Application Support/Code - Insiders/User" | ||
| OS_TYPE="$(uname -s)" | ||
| if [ "$OS_TYPE" = "Darwin" ]; then | ||
| mkdir -p "$TEMP_HOME/Library/Application Support/Code/User" | ||
| mkdir -p "$TEMP_HOME/Library/Application Support/Cursor/User" | ||
| mkdir -p "$TEMP_HOME/Library/Application Support/Windsurf/User" | ||
| mkdir -p "$TEMP_HOME/Library/Application Support/Antigravity/User" | ||
| mkdir -p "$TEMP_HOME/Library/Application Support/Code - Insiders/User" | ||
| else | ||
| mkdir -p "$TEMP_HOME/.config/Code/User" | ||
| mkdir -p "$TEMP_HOME/.config/Cursor/User" | ||
| mkdir -p "$TEMP_HOME/.config/Windsurf/User" | ||
| mkdir -p "$TEMP_HOME/.config/Antigravity/User" | ||
| mkdir -p "$TEMP_HOME/.config/Code - Insiders/User" | ||
| fi | ||
|
|
||
| # Create mock VS Code CLI that lists extensions | ||
| cat >"$MOCK_BIN/code" <<'EOF' | ||
|
|
@@ -88,20 +106,35 @@ End | |
|
|
||
| Describe 'config file syncing' | ||
| setup() { | ||
| mock_bin_setup code fswatch cp | ||
| mock_bin_setup code fswatch cp inotifywait | ||
| TEMP_HOME=$(mktemp -d) | ||
|
|
||
| # Detect OS and create appropriate directories | ||
| OS_TYPE="$(uname -s)" | ||
| if [ "$OS_TYPE" = "Darwin" ]; then | ||
| VSCODE_DIR="$TEMP_HOME/Library/Application Support/Code/User" | ||
| VSCODE_INSIDERS_DIR="$TEMP_HOME/Library/Application Support/Code - Insiders/User" | ||
| CURSOR_DIR="$TEMP_HOME/Library/Application Support/Cursor/User" | ||
| WINDSURF_DIR="$TEMP_HOME/Library/Application Support/Windsurf/User" | ||
| ANTIGRAVITY_DIR="$TEMP_HOME/Library/Application Support/Antigravity/User" | ||
| else | ||
| VSCODE_DIR="$TEMP_HOME/.config/Code/User" | ||
| VSCODE_INSIDERS_DIR="$TEMP_HOME/.config/Code - Insiders/User" | ||
| CURSOR_DIR="$TEMP_HOME/.config/Cursor/User" | ||
| WINDSURF_DIR="$TEMP_HOME/.config/Windsurf/User" | ||
| ANTIGRAVITY_DIR="$TEMP_HOME/.config/Antigravity/User" | ||
| fi | ||
|
|
||
| # Create VS Code user directory with config files | ||
| VSCODE_DIR="$TEMP_HOME/Library/Application Support/Code/User" | ||
| mkdir -p "$VSCODE_DIR" | ||
| echo '{"editor.fontSize": 14}' >"$VSCODE_DIR/settings.json" | ||
| echo '[]' >"$VSCODE_DIR/keybindings.json" | ||
|
|
||
| # Create target directories | ||
| mkdir -p "$TEMP_HOME/Library/Application Support/Cursor/User" | ||
| mkdir -p "$TEMP_HOME/Library/Application Support/Windsurf/User" | ||
| mkdir -p "$TEMP_HOME/Library/Application Support/Antigravity/User" | ||
| mkdir -p "$TEMP_HOME/Library/Application Support/Code - Insiders/User" | ||
| mkdir -p "$CURSOR_DIR" | ||
| mkdir -p "$WINDSURF_DIR" | ||
| mkdir -p "$ANTIGRAVITY_DIR" | ||
| mkdir -p "$VSCODE_INSIDERS_DIR" | ||
|
|
||
| # Create code mock | ||
| cat >"$MOCK_BIN/code" <<'EOF' | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P1: The systemd service PATH is missing
gnugrepandgnusedpackages. The sync.sh script usesgrep(for filtering extensions) andsed(for in-place edits), which are separate packages in Nix, not part ofcoreutils.Prompt for AI agents