Update nix files and stuff

This commit is contained in:
Andrei Jiroh Halili 2024-12-31 13:24:09 +08:00
parent 18b7c4e226
commit 45e09b810a
7 changed files with 813 additions and 12 deletions

15
bin/nix4vscode-config-builder Executable file
View file

@ -0,0 +1,15 @@
#!/usr/bin/env bash
# Output the VSCode version
echo 'vscode_version = "'$(code --version | head -n1)'"'
echo
# Loop through each installed extension
code --list-extensions | while read extension; do
publisher_name=$(echo "$extension" | cut -d '.' -f 1)
extension_name=$(echo "$extension" | cut -d '.' -f 2-)
echo '[[extensions]]'
echo 'publisher_name = "'$publisher_name'"'
echo 'extension_name = "'$extension_name'"'
echo
done

12
bin/nix4vscode-generator Executable file
View file

@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -o pipefail
if [[ $DEBUG != "" ]]; then
set -x
fi
NIX4VSCODE_PATH=$(command -v nix4vscode)
NIX4VSCODE=${NIX4VSCODE:-"$HOME/bin/nix4vscode"}
"$NIX4VSCODE" --output "$HOME/.config/nixos/shared/vscode-extensions.nix" "$HOME/.nix4vscode.toml"
"$NIX4VSCODE" --openvsx --output "$HOME/.config/nixos/shared/openvsx-extensions.nix" "$HOME/.nix4vscode.toml" || true