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,
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;
};
}

View file

@ -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;