Non stop entertainment! The wackiest NixOS configuration to-date. thevoid.cafe/projects/puzzlevision
nixos flake flake-parts dotfiles home-manager nix

🔧⚰️ Clean up Zed configuration

thevoid.cafe 22a1fae5 72b1f3a4

verified
+72 -73
+72 -73
modules/home/apps/zed/default.nix
··· 14 14 options.${namespace}.apps.zed = { 15 15 enable = mkEnableOption "Zed, the graphical editor from the future, with a sane base configuration."; 16 16 enable-nix = mkEnableOption "support for the Nix language, based on nixd, in Zed."; 17 - enable-php = mkEnableOption "support for the PHP language, based on phpactor and pretty-php, in Zed."; 17 + enable-php = mkEnableOption "support for the PHP language, based on intelephense and pretty-php, in Zed."; 18 18 enable-python = mkEnableOption "support for the Python language, based on pylsp, in Zed."; 19 19 enable-typescript = mkEnableOption "support for the TypeScript language, based on bun and oxc, in Zed."; 20 20 }; ··· 23 23 programs.zed-editor = { 24 24 enable = true; 25 25 26 + ## Make Zed config files immutable 27 + mutableUserDebug = false; 28 + mutableUserKeymaps = false; 29 + mutableUserSettings = false; 30 + mutableUserTasks = false; 31 + 32 + ## Enable extensions, based on enabled languages 33 + extensions = [ 34 + "oxc" 35 + "sql" 36 + "fish" 37 + "html" 38 + "scss" 39 + "svelte" 40 + "wakatime" 41 + "dockerfile" 42 + "docker-compose" 43 + ] 44 + ++ lib.optionals cfg.enable-nix [ 45 + "nix" 46 + ] 47 + ++ lib.optionals cfg.enable-php [ 48 + "php" 49 + ] 50 + ++ lib.optionals cfg.enable-python [ 51 + "pylsp" 52 + ] 53 + ++ lib.optionals config.catppuccin.enable [ 54 + "catppuccin" 55 + "catppuccin-icons" 56 + ] 57 + ++ lib.optionals config.programs.nixcord.enable [ 58 + "discord-presence" 59 + ]; 60 + 61 + ## Install additional packages, based on enable languages 62 + extraPackages = 63 + with pkgs; 64 + [ ] 65 + ++ lib.optionals cfg.enable-typescript [ 66 + oxlint 67 + oxfmt 68 + bun 69 + vtsls 70 + ] 71 + ++ lib.optionals cfg.enable-nix [ 72 + nixd 73 + nixfmt 74 + ] 75 + ++ lib.optionals cfg.enable-python [ 76 + python3Packages.python-lsp-server 77 + ] 78 + ++ lib.optionals cfg.enable-php [ 79 + php 80 + phpPackages.composer 81 + pretty-php 82 + intelephense 83 + ]; 84 + 85 + ## Configure Zed user settings 26 86 userSettings = { 27 87 ### Disable telemetry 28 88 telemetry = { ··· 36 96 37 97 ### Disable AI features 38 98 disable_ai = true; 39 - 40 - ### Theme settings 41 - icon_theme = mkForce { 42 - dark = mkIf config.catppuccin.enable "Catppuccin Macchiato"; 43 - light = mkIf config.catppuccin.enable "Catppuccin Latte"; 44 - }; 45 - 46 - theme = mkForce { 47 - dark = mkIf config.catppuccin.enable "Catppuccin Macchiato (blue)"; 48 - light = mkIf config.catppuccin.enable "Catppuccin Latte (blue)"; 49 - }; 50 99 51 100 ### Formatting and saving settings 52 101 formatter = "language_server"; 53 - format_on_save = "on"; 54 102 autosave.after_delay.milliseconds = 0; 55 - 56 - diagnostics.inline.enable = true; 57 103 58 104 indent_guides = { 59 105 enable = true; 60 106 coloring = "indent_aware"; 61 107 }; 62 108 63 - hard_tabs = true; 64 - tab_size = 4; 65 - soft_wrap = "preferred_line_length"; 109 + ### Line-length limits and wrapping configuration 110 + soft_wrap = "bounded"; 111 + preferred_line_length = 100; 66 112 67 113 ### Language specific configurations 68 114 languages = { 115 + #### Nix 69 116 Nix = mkIf cfg.enable-nix { 70 117 language_servers = [ 71 118 "!nil" ··· 81 128 82 129 tab_size = 2; 83 130 }; 131 + #### PHP 84 132 PHP = mkIf cfg.enable-php { 85 133 language_servers = [ 86 134 "!phpactor" ··· 95 143 }; 96 144 }; 97 145 }; 146 + #### TypeScript 98 147 TypeScript = mkIf cfg.enable-typescript { 99 148 language_servers = [ 100 149 "!eslint" 150 + "!prettier" 151 + "!typescript-language-server" 101 152 "oxfmt" 102 153 "oxlint" 103 154 "vtsls" ··· 146 197 "${config.home.homeDirectory}/Documents/Development/Libraries" 147 198 ]; 148 199 }; 149 - 150 - format = { 151 - enable = false; 152 - }; 153 - 154 - maxMemory = 256; 155 200 }; 156 201 }; 157 202 }; 158 203 159 - ### Base editor configurations 204 + ### Basic editor settings 205 + hour_format = "hour24"; 160 206 auto_update = false; 161 - auto_install_extension = { 162 - # Web dev 163 - html = true; 164 - svelte = true; 165 - scss = true; 166 - oxc = true; 167 - 168 - # Languages 169 - nix = cfg.enable-nix; 170 - php = cfg.enable-php; 171 - sql = true; 172 - toml = true; 173 - pylsp = cfg.enable-python; # Python 174 - fish = true; 175 - 176 - # Docker 177 - dockerfile = true; 178 - docker-compose = true; 179 - 180 - # Theming 181 - catppuccin = config.catppuccin.enable; 182 - catppuccin-icons = config.catppuccin.enable; 183 - 184 - # Other 185 - discord-presence = config.programs.nixcord.enable; 186 - wakatime = true; 187 - }; 188 207 }; 189 208 190 209 userKeymaps = [ 191 210 { 192 211 context = "Editor"; 193 212 bindings = { 194 - # This relies on autosave being active, as it overwrites the default file save keybinding 213 + # This relies on autosave being active, as it overwrites the default file save keybinding, and is the only way to format the file at the moment. 195 214 ctrl-s = "editor::Format"; 196 215 }; 197 216 } 198 217 ]; 199 - 200 - extraPackages = 201 - with pkgs; 202 - [ 203 - oxlint 204 - oxfmt 205 - ] 206 - ++ lib.optionals cfg.enable-nix [ 207 - nixd 208 - nixfmt 209 - ] 210 - ++ lib.optionals cfg.enable-python [ 211 - python3Packages.python-lsp-server 212 - ] 213 - ++ lib.optionals cfg.enable-php [ 214 - php 215 - phpPackages.composer 216 - pretty-php 217 - intelephense 218 - ]; 219 218 }; 220 219 }; 221 220 }