home: add zed-editor module

This commit is contained in:
Aly Raffauf 2024-07-13 21:24:21 -04:00
parent d966c37ccf
commit 2150207655
2 changed files with 69 additions and 33 deletions

View file

@ -1,32 +1,68 @@
{ {
pkgs,
lib,
config, config,
lib,
pkgs,
... ...
}: let }: {
cfg = config.ar.home.apps.zed; config = lib.mkIf config.ar.home.apps.zed.enable {
in { home.packages = [
config = lib.mkIf cfg.enable { config.ar.home.apps.zed.package
home.packages = [cfg.package]; pkgs.nixd
];
cfg.settings = lib.mkDefault { xdg.configFile."zed/settings.json".text = let
"buffer_font_family" = "NotoSansM Nerd Font"; defaults = {
"auto_update" = false; auto_install_extensions = {
"vim_mode" = false; adwaita_pastel = true;
"theme" = "Adwaita Pastel Dark"; bahser = true;
"ui_font_size" = 16; docker-compose = true;
"buffer_font_size" = 14; dockerfile = true;
"autosave" = "on_focus_change"; git-firefly = true;
"indent_guides" = { haskell = true;
"enabled" = true; html = true;
"line_width" = 1; ini = true;
"coloring" = "indent_aware"; just = true;
"background_coloring" = "disabled"; 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 = [];
}; };
}; };
xdg.configFile."zed/settings.json".text = telemetry = {
lib.generators.toJSON {} diagnostics = true;
cfg.settings; metrics = true;
};
theme =
if config.ar.home.theme.darkMode
then "Adwaita Pastel Dark"
else "Adwaita Pastel Light";
ui_font_size = 16;
vim_mode = false;
};
settings = defaults // config.ar.home.apps.zed.settings;
in
lib.generators.toJSON {} settings;
}; };
} }

View file

@ -3,7 +3,11 @@ self: {
lib, lib,
pkgs, pkgs,
... ...
}: { }: let
unstable = import self.inputs.nixpkgs-unstable {
system = pkgs.system;
};
in {
imports = [ imports = [
./firefox ./firefox
./mail ./mail
@ -21,22 +25,16 @@ self: {
General.LastActiveDatabase = "${config.home.homeDirectory}/sync/Passwords.kdbx"; General.LastActiveDatabase = "${config.home.homeDirectory}/sync/Passwords.kdbx";
}; };
packages = let packages = [
unstable = import self.inputs.nixpkgs-unstable {
system = pkgs.system;
};
in [
pkgs.browsh pkgs.browsh
pkgs.curl pkgs.curl
pkgs.fractal pkgs.fractal
pkgs.git pkgs.git
pkgs.nixd
pkgs.obsidian pkgs.obsidian
pkgs.python3 pkgs.python3
pkgs.ruby pkgs.ruby
pkgs.tauon pkgs.tauon
pkgs.webcord pkgs.webcord
unstable.zed-editor
]; ];
stateVersion = "24.05"; stateVersion = "24.05";
@ -80,6 +78,8 @@ self: {
keepassxc.enable = true; keepassxc.enable = true;
tmux.enable = true; tmux.enable = true;
vsCodium.enable = true; vsCodium.enable = true;
zed.enable = true;
zed.package = unstable.zed-editor;
}; };
defaultApps.enable = true; defaultApps.enable = true;