Home

helix.drv @ca81e960f7faf55a686e2d5cb24e40840e85cc3d - refs - log -
-
https://git.jolheiser.com/helix.drv.git
My Helix configuration as a Nix derivation
helix.drv / config / languages.nix
- raw -
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{ pkgs }:
with pkgs;
{
  language = [
    {
      name = "go";
      formatter = {
        command = "sh";
        args = [
          "-c"
          "set -o pipefail; ${lib.getExe' gotools "goimports"} | ${lib.getExe gofumpt}"
        ];
      };
    }
    {
      name = "nix";
      auto-format = true;
      formatter = {
        command = "${lib.getExe nixfmt-rfc-style}";
        args = [ "-q" ];
      };
    }
    {
      name = "jsonnet";
      auto-format = true;
      formatter = {
        command = "${lib.getExe' jsonnet "jsonnetfmt"}";
        args = [ "-" ];
      };
    }
    {
      name = "python";
      auto-format = true;
      formatter = {
        args = [
          "format"
          "--stdin-filename"
          "file.py"
          "-"
        ];
        command = "${lib.getExe ruff}";
      };
      language-servers = [ "pylsp" ];
    }
  ];
  language-server = {
    nil.config.nil.nix.flake.autoEvalInputs = true;
    pylsp.config.pylsp = {
      plugins = {
        flake8.enabled = false;
        mypy = {
          dmypy = true;
          enabled = true;
          report_progress = true;
        };
        pycodestyle.enabled = false;
        pyflakes.enabled = false;
        ruff = {
          enabled = true;
          extendSelect = [ "I" ];
          format = [ "I" ];
        };
      };
    };
  };
}