From b33667bfdcdb3e601063b2e7c8c496e6c0cc7ef0 Mon Sep 17 00:00:00 2001 From: jasmine Date: Tue, 24 Dec 2024 13:15:00 +0800 Subject: [PATCH] refactor --- .../features/desktop/editors/default.nix | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/home-manager/sajenim/features/desktop/editors/default.nix b/home-manager/sajenim/features/desktop/editors/default.nix index 3af8991..bc6ba07 100644 --- a/home-manager/sajenim/features/desktop/editors/default.nix +++ b/home-manager/sajenim/features/desktop/editors/default.nix @@ -1,4 +1,7 @@ -{pkgs, ...}: { +{pkgs, ...}: let + # Define a function to add GitHub Copilot plugin to Jetbrains IDEs + addGithubCopilot = ide: pkgs.jetbrains.plugins.addPlugins ide ["github-copilot"]; +in { # Enable Visual Studio Code (VSCode) program programs.vscode = { enable = true; @@ -12,15 +15,9 @@ pkgs.gcc # GCC compiler pkgs.python39 # Python 3.9 interpreter - # Jetbrains IDE's with GitHub Copilot plugin enabled - (pkgs.jetbrains.plugins.addPlugins pkgs.jetbrains.clion [ - "github-copilot" - ]) - (pkgs.jetbrains.plugins.addPlugins pkgs.jetbrains.idea-ultimate [ - "github-copilot" - ]) - (pkgs.jetbrains.plugins.addPlugins pkgs.jetbrains.pycharm-professional [ - "github-copilot" - ]) + # Add GitHub Copilot plugin to Jetbrains IDEs + (addGithubCopilot pkgs.jetbrains.clion) + (addGithubCopilot pkgs.jetbrains.idea-ultimate) + (addGithubCopilot pkgs.jetbrains.pycharm-professional) ]; }