From 215020765529b052ea270bc71b382ee7b13c8ea8 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Sat, 13 Jul 2024 21:24:21 -0400 Subject: [PATCH] home: add zed-editor module --- homeManagerModules/apps/zed/default.nix | 86 ++++++++++++++++++------- homes/aly/default.nix | 16 ++--- 2 files changed, 69 insertions(+), 33 deletions(-) diff --git a/homeManagerModules/apps/zed/default.nix b/homeManagerModules/apps/zed/default.nix index d4f67284..7336f483 100644 --- a/homeManagerModules/apps/zed/default.nix +++ b/homeManagerModules/apps/zed/default.nix @@ -1,32 +1,68 @@ { - pkgs, - lib, config, + lib, + pkgs, ... -}: let - cfg = config.ar.home.apps.zed; -in { - config = lib.mkIf cfg.enable { - home.packages = [cfg.package]; +}: { + config = lib.mkIf config.ar.home.apps.zed.enable { + home.packages = [ + config.ar.home.apps.zed.package + pkgs.nixd + ]; - cfg.settings = lib.mkDefault { - "buffer_font_family" = "NotoSansM Nerd Font"; - "auto_update" = false; - "vim_mode" = false; - "theme" = "Adwaita Pastel Dark"; - "ui_font_size" = 16; - "buffer_font_size" = 14; - "autosave" = "on_focus_change"; - "indent_guides" = { - "enabled" = true; - "line_width" = 1; - "coloring" = "indent_aware"; - "background_coloring" = "disabled"; + xdg.configFile."zed/settings.json".text = let + defaults = { + auto_install_extensions = { + adwaita_pastel = true; + bahser = true; + docker-compose = true; + dockerfile = true; + git-firefly = true; + haskell = true; + html = true; + ini = true; + just = true; + log = true; + make = true; + nix = true; + python = true; + ruby = true; + }; + + auto_update = false; + autosave = "on_focus_change"; + buffer_font_family = "NotoSansM Nerd Font"; + buffer_font_size = 14; + + indent_guides = { + enabled = true; + background_coloring = "disabled"; + coloring = "indent_aware"; + line_width = 1; + }; + + languages = { + Nix.formatter.external = { + command = lib.getExe pkgs.alejandra; + arguments = []; + }; + }; + + telemetry = { + diagnostics = true; + metrics = true; + }; + + theme = + if config.ar.home.theme.darkMode + then "Adwaita Pastel Dark" + else "Adwaita Pastel Light"; + + ui_font_size = 16; + vim_mode = false; }; - }; - - xdg.configFile."zed/settings.json".text = - lib.generators.toJSON {} - cfg.settings; + settings = defaults // config.ar.home.apps.zed.settings; + in + lib.generators.toJSON {} settings; }; } diff --git a/homes/aly/default.nix b/homes/aly/default.nix index c21b2c27..715c6f58 100644 --- a/homes/aly/default.nix +++ b/homes/aly/default.nix @@ -3,7 +3,11 @@ self: { lib, pkgs, ... -}: { +}: let + unstable = import self.inputs.nixpkgs-unstable { + system = pkgs.system; + }; +in { imports = [ ./firefox ./mail @@ -21,22 +25,16 @@ self: { General.LastActiveDatabase = "${config.home.homeDirectory}/sync/Passwords.kdbx"; }; - packages = let - unstable = import self.inputs.nixpkgs-unstable { - system = pkgs.system; - }; - in [ + packages = [ pkgs.browsh pkgs.curl pkgs.fractal pkgs.git - pkgs.nixd pkgs.obsidian pkgs.python3 pkgs.ruby pkgs.tauon pkgs.webcord - unstable.zed-editor ]; stateVersion = "24.05"; @@ -80,6 +78,8 @@ self: { keepassxc.enable = true; tmux.enable = true; vsCodium.enable = true; + zed.enable = true; + zed.package = unstable.zed-editor; }; defaultApps.enable = true;