make cursor extension declarative
This commit is contained in:
parent
eb8de3fbeb
commit
bd513a60c5
1 changed files with 19 additions and 4 deletions
|
|
@ -9,6 +9,13 @@ let
|
||||||
then "/opt/homebrew/bin/cursor"
|
then "/opt/homebrew/bin/cursor"
|
||||||
else "cursor";
|
else "cursor";
|
||||||
|
|
||||||
|
extensions = [
|
||||||
|
"vscodevim.vim"
|
||||||
|
"jdinhlife.gruvbox"
|
||||||
|
"jnoortheen.nix-ide"
|
||||||
|
"tomoki1207.pdf"
|
||||||
|
];
|
||||||
|
|
||||||
ideSettings = {
|
ideSettings = {
|
||||||
"editor.fontFamily" = "'JetBrainsMono Nerd Font Mono', 'Noto Sans CJK SC', 'Noto Sans CJK TC', monospace";
|
"editor.fontFamily" = "'JetBrainsMono Nerd Font Mono', 'Noto Sans CJK SC', 'Noto Sans CJK TC', monospace";
|
||||||
"editor.fontSize" = 14;
|
"editor.fontSize" = 14;
|
||||||
|
|
@ -52,10 +59,18 @@ in
|
||||||
|
|
||||||
home.activation.installCursorExtensions = config.lib.dag.entryAfter ["writeBoundary"] ''
|
home.activation.installCursorExtensions = config.lib.dag.entryAfter ["writeBoundary"] ''
|
||||||
if command -v ${cursorCmd} &> /dev/null; then
|
if command -v ${cursorCmd} &> /dev/null; then
|
||||||
run ${cursorCmd} --install-extension vscodevim.vim &> /dev/null || true
|
desired="${lib.concatStringsSep " " extensions}"
|
||||||
run ${cursorCmd} --install-extension jdinhlife.gruvbox &> /dev/null || true
|
installed=$(${cursorCmd} --list-extensions 2>/dev/null | tr '[:upper:]' '[:lower:]')
|
||||||
run ${cursorCmd} --install-extension jnoortheen.nix-ide &> /dev/null || true
|
|
||||||
run ${cursorCmd} --install-extension tomoki1207.pdf &> /dev/null || true
|
for ext in $installed; do
|
||||||
|
if ! echo "$desired" | tr '[:upper:]' '[:lower:]' | grep -qw "$ext"; then
|
||||||
|
run ${cursorCmd} --uninstall-extension "$ext" &> /dev/null || true
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
for ext in ${lib.concatStringsSep " " extensions}; do
|
||||||
|
run ${cursorCmd} --install-extension "$ext" &> /dev/null || true
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue