diff --git a/README.md b/README.md index 007d0b7..f626203 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ Edit `dotfiles/nix/environment.nix` and add your aliases to the `shellAliases` s - **Nix Packages**: Add to the `systemPackages` list in `dotfiles/nix/environment.nix` - **Homebrew Packages**: Add to the appropriate section in `dotfiles/nix/homebrew.nix` +- **JetBrains IDEs with Plugins**: Configure in `dotfiles/nix/jetbrains.nix` Note: Always prefer nix packages over Homebrew packages when possible. @@ -101,9 +102,38 @@ This repository uses pre-commit hooks to ensure code quality and prevent secrets - **flake.nix**: Main Nix configuration entry point - **environment.nix**: Environment variables and packages - **homebrew.nix**: Homebrew packages and configuration + - **jetbrains.nix**: JetBrains IDEs with declarative plugin management - **core.nix, system.nix, etc.**: Other system configuration files - **manual-linking.sh**: Script to create symbolic links for dotfiles +## JetBrains IDE Configuration + +This setup includes declarative configuration for JetBrains IDEs with plugin management through [nix-jetbrains-plugins](https://github.com/theCapypara/nix-jetbrains-plugins). + +### Included IDEs and Plugins + +The configuration in `dotfiles/nix/jetbrains.nix` includes: + +- **IntelliJ IDEA Ultimate** with common development plugins +- **WebStorm** with common web development plugins + +Additional IDEs (GoLand, Rider) are available but commented out to reduce initial download size. + +### Common Plugins Included + +- File Watcher - Monitor file changes and run tasks automatically +- .ignore - Enhanced support for .gitignore and other ignore files +- GitHub integration - Enhanced Git/GitHub support (if not built-in) + +### Customizing JetBrains Setup + +To add or remove IDEs or plugins, edit `dotfiles/nix/jetbrains.nix`. + +**Finding Plugin IDs**: Plugin IDs can be found at the bottom of JetBrains Marketplace pages. +Example: Visit https://plugins.jetbrains.com/plugin/7374-gitignore and scroll to bottom to find ID: `mobi.hsz.idea.gitignore` + +**Adding More IDEs**: Uncomment the additional IDE configurations in `jetbrains.nix` as needed. + ## TODOs - [x] Create a backup/restore mechanism (implemented in update-system.sh) diff --git a/dotfiles/nix/environment.nix b/dotfiles/nix/environment.nix index ac4d158..91d78d3 100644 --- a/dotfiles/nix/environment.nix +++ b/dotfiles/nix/environment.nix @@ -78,6 +78,7 @@ in dotnetCorePackages.sdk_8_0 # .NET Core SDK # Temporary disabled because of storage issues + # Now managed through jetbrains.nix module #jetbrains.idea-ultimate #jetbrains.webstorm #jetbrains.goland diff --git a/dotfiles/nix/flake.nix b/dotfiles/nix/flake.nix index d584904..91dd6c3 100644 --- a/dotfiles/nix/flake.nix +++ b/dotfiles/nix/flake.nix @@ -34,9 +34,14 @@ flake = false; }; colmena.url = "github:zhaofengli/colmena"; + + nix-jetbrains-plugins = { + url = "github:theCapypara/nix-jetbrains-plugins"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = { self, nix-darwin, nixpkgs, nix-homebrew, nixpkgs-nh-dev, home-manager, ... }@inputs: + outputs = { self, nix-darwin, nixpkgs, nix-homebrew, nixpkgs-nh-dev, home-manager, nix-jetbrains-plugins, ... }@inputs: let base = { system.configurationRevision = self.rev or self.dirtyRev or null; @@ -46,7 +51,7 @@ # Build darwin flake using: # $ darwin-rebuild build --flake .#Lars-MacBook-Air darwinConfigurations."Lars-MacBook-Air" = nix-darwin.lib.darwinSystem { - specialArgs = { inherit nixpkgs-nh-dev; }; + specialArgs = { inherit nixpkgs-nh-dev nix-jetbrains-plugins; }; modules = [ # Core system configuration base @@ -61,6 +66,9 @@ # Programs ./programs.nix + + # JetBrains configuration + ./jetbrains.nix # Homebrew integration ./homebrew.nix diff --git a/dotfiles/nix/jetbrains.nix b/dotfiles/nix/jetbrains.nix new file mode 100644 index 0000000..c9579d5 --- /dev/null +++ b/dotfiles/nix/jetbrains.nix @@ -0,0 +1,44 @@ +{ pkgs, lib, nix-jetbrains-plugins, ... }: + +let + system = pkgs.stdenv.hostPlatform.system; + + # Convenience function from nix-jetbrains-plugins + buildIdeWithPlugins = nix-jetbrains-plugins.lib."${system}".buildIdeWithPlugins; + + # Common plugins that are useful across most JetBrains IDEs + # Plugin IDs from JetBrains Marketplace (shown at bottom of plugin pages) + commonPluginIds = [ + "com.intellij.plugins.watcher" # File Watcher - monitor file changes + "mobi.hsz.idea.gitignore" # .ignore - gitignore and other ignore files support + "org.jetbrains.plugins.github" # GitHub integration (if not built-in) + ]; + + # Popular additional plugins (using proper plugin IDs) + enhancementPluginIds = [ + "IdeaVIM" # Vim emulation (plugin ID: IdeaVIM) + "String Manipulation" # String manipulation utilities + ]; + +in +{ + environment.systemPackages = with pkgs; [ + # Start with the most commonly used IDEs + + # IntelliJ IDEA Ultimate - primary IDE for Java/Kotlin development + (buildIdeWithPlugins jetbrains "idea-ultimate" commonPluginIds) + + # WebStorm - for web development (JavaScript, TypeScript, etc.) + (buildIdeWithPlugins jetbrains "webstorm" commonPluginIds) + + # Uncomment additional IDEs as needed: + # GoLand for Go development + # (buildIdeWithPlugins jetbrains "goland" commonPluginIds) + + # Rider for .NET development + # (buildIdeWithPlugins jetbrains "rider" commonPluginIds) + ]; + + # Note: Plugin IDs can be found at the bottom of JetBrains Marketplace pages + # Example: https://plugins.jetbrains.com/plugin/7374-gitignore -> ID: mobi.hsz.idea.gitignore +} \ No newline at end of file