about summary refs log tree commit diff
path: root/modules/vscode.nix
diff options
context:
space:
mode:
authorazahi <azat@bahawi.net>2025-02-17 02:21:56 +0300
committerazahi <azat@bahawi.net>2025-02-17 02:21:56 +0300
commit59180328cda59817d71cd58c8f48ead047375064 (patch)
tree2cdd7d1bfa309839ef624c19daf283f510aacf69 /modules/vscode.nix
parent2025-02-05 (diff)
2025-02-17
Diffstat (limited to '')
-rw-r--r--modules/vscode.nix128
1 files changed, 63 insertions, 65 deletions
diff --git a/modules/vscode.nix b/modules/vscode.nix
index 3b0c3e1..0eebdda 100644
--- a/modules/vscode.nix
+++ b/modules/vscode.nix
@@ -5,34 +5,34 @@
   pkgs,
   ...
 }:
-with lib;
 let
   cfg = config.nixfiles.modules.vscode;
 in
 {
   options.nixfiles.modules.vscode = {
-    enable = mkEnableOption "VSCode";
+    enable = lib.mkEnableOption "VSCode";
 
-    package =
-      with pkgs;
-      mkOption {
-        type = types.enum [
+    package = lib.mkOption {
+      type = lib.types.enum (
+        with pkgs;
+        [
           vscodium
           vscode
           vscode-fhs
-        ];
-        default = vscodium;
-        description = "Which package to use as a VSCode implementation.";
-      };
+        ]
+      );
+      default = pkgs.vscodium;
+      description = "Which package to use as a VSCode implementation.";
+    };
 
-    vim.enable = mkOption {
-      type = types.bool;
+    vim.enable = lib.mkOption {
+      type = lib.types.bool;
       default = true;
       description = "Whether to enable Vim emulation.";
     };
   };
 
-  config = mkIf cfg.enable {
+  config = lib.mkIf cfg.enable {
     hm = {
       stylix.targets.vscode.enable = false;
 
@@ -77,7 +77,7 @@ in
               task.vscode-task
               vscode-org-mode.org-mode
             ]
-            ++ optional cfg.vim.enable vscodevim.vim;
+            ++ lib.optional cfg.vim.enable vscodevim.vim;
 
           userSettings = {
             # Something tries to write this every startup. I can't be arsed to
@@ -153,20 +153,18 @@ in
                 useFullyQualifiedCollectionNames = true;
                 reuseTerminal = true;
               };
-              validation.lint.path = getExe' pkgs.ansible-lint "ansible-lint";
+              validation.lint.path = lib.getExe' pkgs.ansible-lint "ansible-lint";
             };
 
-            bashIde.shellcheckPath = getExe' pkgs.shellcheck "shellcheck";
+            bashIde.shellcheckPath = lib.getExe' pkgs.shellcheck "shellcheck";
 
             cSpell.language = "en-GB,en,ru";
 
-            direnv = {
-              restart.automatic = true;
-            };
+            direnv.restart.automatic = true;
 
             magit = {
               forge-enabled = true;
-              git-path = getExe config.hm.programs.git.package;
+              git-path = lib.getExe config.hm.programs.git.package;
             };
 
             git.openRepositoryInParentFolders = "always";
@@ -176,55 +174,55 @@ in
               gitProtocol = "ssh";
             };
 
-            terraform = {
-              languageServer.path = getExe' pkgs.terraform-ls "terraform-ls";
-              languageServer.terraform.path = getExe pkgs.opentofu;
-            };
+            # terraform = {
+            #   languageServer.path = lib.getExe' pkgs.terraform-ls "terraform-ls";
+            #   languageServer.terraform.path = lib.getExe pkgs.opentofu;
+            # };
 
-            haskell = {
-              formattingProvider = "ormolu";
-              serverExecutablePath = getExe' pkgs.haskell-language-server "haskell-language-server";
-            };
+            # haskell = {
+            #   formattingProvider = "ormolu";
+            #   serverExecutablePath = lib.getExe' pkgs.haskell-language-server "haskell-language-server";
+            # };
 
             nix = {
-              formatterPath = getExe pkgs.nixfmt;
+              formatterPath = lib.getExe pkgs.nixfmt;
               enableLanguageServer = true;
-              serverPath = getExe pkgs.nixd;
-              serverSettings.nixd.formatting.command = getExe pkgs.nixfmt;
-            };
-
-            python = with pkgs.python311Packages; {
-              experiments.optOutFrom = [ "All" ];
-              pipenvPath = getExe' pkgs.pipenv "pipenv";
-              poetryPath = getExe' pkgs.poetry "poetry";
-              formatting = {
-                provider = "black";
-                autopep8Path = getExe' autopep8 "autopep8";
-                blackPath = getExe' black "black";
-                yapfPath = getExe' yapf "yapf";
-              };
-              linting = {
-                enabled = true;
-                banditPath = getExe' bandit "bandit";
-                flake8Path = getExe' flake8 "flake8";
-                mypyPath = getExe' mypy "mypy";
-                pycodestylePath = getExe' pycodestyle "pycodestyle";
-                pydocstylePath = getExe' pydocstyle "pydocstyle";
-                pylamaPath = getExe' pylama "pylama";
-                pylintPath = getExe' pylint "pylint";
-              };
-              testing = {
-                pytestPath = getExe' pytest "pytest";
-              };
-            };
-
-            rust-client = {
-              disableRustup = true;
-              rustupPath = getExe' pkgs.rustup "rustup";
-              rustfmt_path = getExe pkgs.rustfmt;
-            };
-
-            vim = mkIf cfg.vim.enable {
+              serverPath = lib.getExe pkgs.nixd;
+              serverSettings.nixd.formatting.command = lib.getExe pkgs.nixfmt;
+            };
+
+            # python = with pkgs.python311Packages; {
+            #   experiments.optOutFrom = [ "All" ];
+            #   pipenvPath = lib.getExe' pkgs.pipenv "pipenv";
+            #   poetryPath = lib.getExe' pkgs.poetry "poetry";
+            #   formatting = {
+            #     provider = "black";
+            #     autopep8Path = lib.getExe' autopep8 "autopep8";
+            #     blackPath = lib.getExe' black "black";
+            #     yapfPath = lib.getExe' yapf "yapf";
+            #   };
+            #   linting = {
+            #     enabled = true;
+            #     banditPath = lib.getExe' bandit "bandit";
+            #     flake8Path = lib.getExe' flake8 "flake8";
+            #     mypyPath = lib.getExe' mypy "mypy";
+            #     pycodestylePath = lib.getExe' pycodestyle "pycodestyle";
+            #     pydocstylePath = lib.getExe' pydocstyle "pydocstyle";
+            #     pylamaPath = lib.getExe' pylama "pylama";
+            #     pylintPath = lib.getExe' pylint "pylint";
+            #   };
+            #   testing = {
+            #     pytestPath = lib.getExe' pytest "pytest";
+            #   };
+            # };
+
+            # rust-client = {
+            #   disableRustup = true;
+            #   rustupPath = lib.getExe' pkgs.rustup "rustup";
+            #   rustfmt_path = lib.getExe pkgs.rustfmt;
+            # };
+
+            vim = lib.mkIf cfg.vim.enable {
               easymotion = true;
 
               leader = " ";

Consider giving Nix/NixOS a try! <3