Skip to content

Commit

Permalink
feat: use nix4vscode to use version compatable extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
DaRacci committed Jan 18, 2025
1 parent 3c11a51 commit 76c6c19
Show file tree
Hide file tree
Showing 6 changed files with 442 additions and 31 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/vscode.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Update VSCode Extensions

on:
workflow_dispatch:
schedule:
- cron: "0 0 * * */3"

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-nix
with:
arch: x86_64-linux

- run: |
DIR="modules/purpose/development/vscode"
CONFIG="$DIR/config.toml"
NIX_FILE="$DIR/extensions.nix"
VSCODE_VERSION=$(nix eval --raw nixpkgs#vscode.version)
sed -i "s/vscode_version = \".*\"/vscode_version = \"$VSCODE_VERSION\"/" modules/purpose/development/vscode/config.toml
nix run github:nix-community/nix4vscode -- "$CONFIG" -o "$NIX_FILE"
- uses: EndBug/add-and-commit@v9
with:
message: "chore(deps): Update VSCode extensions"
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@
};

pre-commit = {
excludes = [
"secrets.yaml"
"extensions.nix"
];

hooks = {
typos = {
enable = true;
Expand All @@ -185,9 +190,8 @@
"Optin"
"tere"
"ags"
"hassio"
];

exclude = "secrets.yaml";
};
};
editorconfig-checker.enable = true;
Expand All @@ -196,7 +200,10 @@
nil.enable = true;
deadnix.enable = true;
nixpkgs-fmt.enable = true;
statix.enable = true;
statix = {
enable = true;
settings.ignore = [ "extensions.nix" ];
};
};
};

Expand Down
52 changes: 27 additions & 25 deletions modules/home-manager/purpose/development/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,57 +39,59 @@ in
let
extensions = inputs.vscode-extensions.extensions.${pkgs.stdenv.system};
versionExtensions = extensions.forVSCodeVersion config.programs.vscode.package.version;

plugins = (import ./vscode/extensions.nix) { inherit pkgs lib; };
in
with extensions.vscode-marketplace; [
# Theme & Looks
zhuangtongfa.material-theme
pkief.material-icon-theme
plugins.zhuangtongfa.material-theme
plugins.pkief.material-icon-theme

# Workspaces & Projects
mkhl.direnv
editorconfig.editorconfig
alefragnani.project-manager
ms-vscode-remote.remote-ssh
plugins.mkhl.direnv
plugins.editorconfig.editorconfig
plugins.alefragnani.project-manager
plugins.ms-vscode-remote.remote-ssh

# Sidebar Additions
gruntfuggly.todo-tree
eamodio.gitlens
plugins.gruntfuggly.todo-tree
plugins.eamodio.gitlens

# Language Support
redhat.vscode-xml
redhat.vscode-yaml
tamasfe.even-better-toml
matthewpi.caddyfile-support
coolbear.systemd-unit-file
hashicorp.terraform
bierner.markdown-preview-github-styles
ruschaaf.extended-embedded-languages
plugins.tamasfe.even-better-toml
plugins.matthewpi.caddyfile-support
plugins.coolbear.systemd-unit-file
plugins.hashicorp.terraform
plugins.bierner.markdown-preview-github-styles
plugins.ruschaaf.extended-embedded-languages

# LSP Servers
jnoortheen.nix-ide
ms-vscode.powershell
plugins.jnoortheen.nix-ide
plugins.ms-vscode.powershell

# Formatters
esbenp.prettier-vscode
plugins.esbenp.prettier-vscode

# Containers
ms-azuretools.vscode-docker
plugins.ms-azuretools.vscode-docker

# AI
github.copilot
github.copilot-chat
plugins.github.copilot
plugins.github.copilot-chat

# Other
formulahendry.code-runner
plugins.formulahendry.code-runner
# platformio.platformio-ide

# Bash Extensions
rogalmic.bash-debug
foxundermoon.shell-format
plugins.rogalmic.bash-debug
plugins.foxundermoon.shell-format

# Integrations
github.vscode-github-actions
github.vscode-pull-request-github
plugins.github.vscode-github-actions
plugins.github.vscode-pull-request-github
] ++ (optionals cfg.python.enable (with versionExtensions.vscode-marketplace.ms-python; [
python
vscode-pylance
Expand Down
133 changes: 133 additions & 0 deletions modules/home-manager/purpose/development/vscode/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
vscode_version = "1.95.3"

[[extensions]]
publisher_name = "alefragnani"
extension_name = "project-manager"

[[extensions]]
publisher_name = "bierner"
extension_name = "markdown-preview-github-styles"

[[extensions]]
publisher_name = "coolbear"
extension_name = "systemd-unit-file"

[[extensions]]
publisher_name = "dustypomerleau"
extension_name = "rust-syntax"

[[extensions]]
publisher_name = "eamodio"
extension_name = "gitlens"

[[extensions]]
publisher_name = "editorconfig"
extension_name = "editorconfig"

[[extensions]]
publisher_name = "esbenp"
extension_name = "prettier-vscode"

[[extensions]]
publisher_name = "fill-labs"
extension_name = "dependi"

[[extensions]]
publisher_name = "formulahendry"
extension_name = "code-runner"

[[extensions]]
publisher_name = "foxundermoon"
extension_name = "shell-format"

[[extensions]]
publisher_name = "github"
extension_name = "copilot"

[[extensions]]
publisher_name = "github"
extension_name = "copilot-chat"

[[extensions]]
publisher_name = "github"
extension_name = "vscode-github-actions"

[[extensions]]
publisher_name = "github"
extension_name = "vscode-pull-request-github"

[[extensions]]
publisher_name = "gruntfuggly"
extension_name = "todo-tree"

[[extensions]]
publisher_name = "hashicorp"
extension_name = "terraform"

[[extensions]]
publisher_name = "jnoortheen"
extension_name = "nix-ide"

[[extensions]]
publisher_name = "jscearcy"
extension_name = "rust-doc-viewer"

[[extensions]]
publisher_name = "matthewpi"
extension_name = "caddyfile-support"

[[extensions]]
publisher_name = "mkhl"
extension_name = "direnv"

[[extensions]]
publisher_name = "ms-azuretools"
extension_name = "vscode-docker"

[[extensions]]
publisher_name = "ms-vscode-remote"
extension_name = "remote-ssh"

[[extensions]]
publisher_name = "ms-vscode"
extension_name = "powershell"

[[extensions]]
publisher_name = "pkief"
extension_name = "material-icon-theme"

[[extensions]]
publisher_name = "redhat"
extension_name = "vscode-xml"

[[extensions]]
publisher_name = "redhat"
extension_name = "vscode-yaml"

[[extensions]]
publisher_name = "rogalmic"
extension_name = "bash-debug"

[[extensions]]
publisher_name = "ruschaaf"
extension_name = "extended-embedded-languages"

[[extensions]]
publisher_name = "rust-lang"
extension_name = "rust-analyzer"

[[extensions]]
publisher_name = "stylix"
extension_name = "stylix"

[[extensions]]
publisher_name = "tamasfe"
extension_name = "even-better-toml"

[[extensions]]
publisher_name = "vadimcn"
extension_name = "vscode-lldb"

[[extensions]]
extension_name = "material-theme"
publisher_name = "zhuangtongfa"
Loading

0 comments on commit 76c6c19

Please sign in to comment.