aboutsummaryrefslogtreecommitdiff
path: root/modules/home/editors/zed/default.nix
blob: 58835fbc8df96757168dc47cb2448b92c6612885 (plain)
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
{
  config,
  lib,
  ...
}:

let
  inherit (lib)
    mkEnableOption
    mkOption
    types
    mkIf
    optionals
    ;
  cfg = config.nx.editors.zed-editor;
in
{
  options.nx.editors.zed-editor = {
    enable = mkEnableOption "zed editor";

    langs = {
      nix = mkOption {
        description = "enable nix integration";
        type = types.bool;
        default = true;
      };
      python = mkOption {
        description = "enable python integration";
        type = types.bool;
        default = false;
      };
      rust = mkOption {
        description = "enable rust integration";
        type = types.bool;
        default = false;
      };
      go = mkOption {
        description = "enable go integration";
        type = types.bool;
        default = false;
      };
      lua = mkOption {
        description = "enable lua integration";
        type = types.bool;
        default = false;
      };
      docker = mkOption {
        description = "enable docker integration";
        type = types.bool;
        default = false;
      };
      java = mkOption {
        description = "enable java integration";
        type = types.bool;
        default = false;
      };
      cmake = mkOption {
        description = "enable cmake integration";
        type = types.bool;
        default = false;
      };
      toml = mkOption {
        description = "enable toml integration";
        type = types.bool;
        default = false;
      };
    };
  };

  config = mkIf cfg.enable {
    programs.zed-editor = {
      enable = true;
      extensions =
        [ ]
        ++ (optionals cfg.langs.nix [ "nix" ])
        ++ (optionals cfg.langs.python [ "python" ])
        ++ (optionals cfg.langs.rust [ "rust" ])
        ++ (optionals cfg.langs.go [ "go" ])
        ++ (optionals cfg.langs.lua [ "lua" ])
        ++ (optionals cfg.langs.docker [ "dockerfile" ])
        ++ (optionals cfg.langs.java [ "java" ])
        ++ (optionals cfg.langs.cmake [ "cmake" ])
        ++ (optionals cfg.langs.toml [ "toml" ]);
      userSettings = {
        telemetry = {
          metrics = false;
        };
        title_bar = {
          show_onboarding_banner = false;
          show_project_items = false;
          show_branch_name = false;
          show_user_menu = false;
        };
        tab_bar.show = false;
        toolbar.quick_actions = false;
        status_bar."experimental.show" = false;
        project_panel = {
          dock = "right";
          default_width = 400;
          hide_root = true;
          auto_fold_dirs = false;
          starts_open = false;
          git_status = false;
          sticky_scroll = false;
          scrollbar.show = "never";
          indent_guides.show = "never";
        };
        outline_panel = {
          default_width = 300;
          indent_guides.show = "never";
        };
        file_finder.modal_max_width = "large";
      };
    };
  };
}