diff options
| author | Leander Scherer <leander@schererleander.de> | 2026-01-08 02:48:11 +0100 |
|---|---|---|
| committer | Leander Scherer <leander@schererleander.de> | 2026-01-08 19:08:12 +0100 |
| commit | 6174f3650cf42aaf008012e828d5a1f8e2ce037f (patch) | |
| tree | 9bbbd99680cd5adb56596a14734d4896bc6af733 /modules/users/editors/zed | |
| parent | c582c4d0675aada46fa196b7af1941ed753d055f (diff) | |
refactor(modules): separate nixos/home-manager modules, use standard option conventions
Diffstat (limited to 'modules/users/editors/zed')
| -rw-r--r-- | modules/users/editors/zed/default.nix | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/modules/users/editors/zed/default.nix b/modules/users/editors/zed/default.nix new file mode 100644 index 0000000..5ff0714 --- /dev/null +++ b/modules/users/editors/zed/default.nix @@ -0,0 +1,94 @@ +{ + config, + lib, + ... +}: + +let + inherit (lib) + mkOption + types + mkIf + optionals + ; + cfg = config.nx.editors.zed-editor; +in +{ + options.nx.editors.zed-editor = { + enable = mkOption { + description = "Enable and setup zed editor"; + type = types.bool; + default = false; + }; + + 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; + }; + }; + }; + }; +} |
