commit ee1e39329537c75df3f5fb5e780a8b65fbf87252
parent 8fac979ef3426e9264d553de931c161eeb523c97
Author: maydayv7 <maydayv7@gmail.com>
Date: Wed, 1 Jul 2026 01:31:40 +0530
feat: Zed Editor
Diffstat:
17 files changed, 148 insertions(+), 41 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
@@ -2,6 +2,7 @@
### June
+- Add Zed Editor
- Rename `nixos` script to `os` and adopt [`nh`](https://github.com/nix-community/nh)
- Use `micro` as default editor
- Use [`disko`](https://github.com/nix-community/disko) for declarative disk partitioning
diff --git a/files/vscode/settings.json b/files/vscode/settings.json
@@ -41,9 +41,9 @@
"better-comments.highlightPlainText": true,
"scm.repositories.visible": 7,
"nix.enableLanguageServer": true,
- "nix.serverPath": "nil",
+ "nix.serverPath": "nixd",
"nix.serverSettings": {
- "nil": {
+ "nixd": {
"formatting": {
"command": ["alejandra"]
}
diff --git a/modules/README.md b/modules/README.md
@@ -31,6 +31,7 @@ An overview of every configuration module in this repository.
| `youtube` | Home Manager | YouTube Music & TUI |
| `vscode` | Home Manager | Visual Studio Code editor |
| `antigravity` | Home Manager | Google Antigravity |
+| `zed` | Home Manager | Zed Editor |
| `flatpak` | Both | Flatpak app sandboxing |
| `latex` | Both | LaTeX typesetting |
| `office` | Both | Office suite environment |
diff --git a/modules/apps/syncthing.nix b/modules/apps/syncthing.nix
@@ -1,6 +1,6 @@
## Syncthing Configuration ##
-# ? # Configure via Web UI: http://localhost:8384
-# ? # Shared directory is at 'files.path.sync'
+#? Configure via Web UI: http://localhost:8384
+#? Shared directory is at 'files.path.sync'
{
flake.modules.homeManager.syncthing = {
services.syncthing.enable = true;
diff --git a/modules/apps/vscode/default.nix b/modules/apps/vscode/default.nix
@@ -46,7 +46,7 @@ in {
".vscode-shared"
];
packages = with pkgs; [
- nil
+ nixd
alejandra
];
};
diff --git a/modules/apps/zed.nix b/modules/apps/zed.nix
@@ -0,0 +1,117 @@
+## Zed Editor ##
+{config, ...}: let
+ inherit (config) util;
+in {
+ flake.modules.homeManager.zed = {
+ lib,
+ pkgs,
+ osConfig ? {},
+ ...
+ }: let
+ isGnome = osConfig.services.desktopManager.gnome.enable or false;
+ isWM = (osConfig.programs.hyprland.enable or false) || (osConfig.programs.niri.enable or false);
+ in {
+ xdg.mimeApps = let
+ mime = util.build.mime {
+ code = ["dev.zed.Zed.desktop"];
+ markdown = ["dev.zed.Zed.desktop"];
+ text = ["dev.zed.Zed.desktop"];
+ };
+ in {
+ defaultApplications = mime;
+ associations.added = mime;
+ };
+
+ home.persist.directories = [".config/zed"];
+ programs.zed-editor = {
+ enable = true;
+ package = pkgs.zed-editor;
+ extraPackages = with pkgs; [
+ nixd
+ alejandra
+ ];
+
+ ## Settings
+ userSettings = lib.mkMerge [
+ {
+ # Editor
+ "format_on_save" = "on";
+ "ensure_final_newline_on_save" = true;
+ "remove_trailing_whitespace_on_save" = true;
+ "cursor_blink" = true;
+ "cursor_shape" = "bar";
+ "scrollbar"."show" = "auto";
+ "use_smartcase_search" = true;
+ "autosave" = "on_window_change";
+ "close_on_file_delete" = true;
+ "when_closing_with_no_tabs" = "close_window";
+
+ # Terminal
+ "terminal"."cursor_shape" = "bar";
+
+ # Telemetry
+ "auto_update" = false;
+ "features"."edit_prediction_provider" = "none";
+ "telemetry" = {
+ "diagnostics" = false;
+ "metrics" = false;
+ };
+
+ # Icons
+ "icon_theme" = lib.mkDefault "Material Icon Theme";
+
+ # Formatters
+ "languages"."Nix" = {
+ "language_servers" = ["nixd"];
+ "formatter"."external" = {
+ "command" = "alejandra";
+ "arguments" = ["-q" "-"];
+ };
+ };
+ }
+ (lib.mkIf isGnome {
+ "terminal"."shell"."program" = "ghostty";
+ })
+ (lib.mkIf isWM {
+ "terminal"."shell"."program" = "kitty";
+ })
+ ];
+
+ # Keymaps
+ userKeymaps = [
+ {
+ context = "Workspace";
+ bindings = {
+ "ctrl-/" = "command_palette::Toggle";
+ "alt-t" = "terminal_panel::ToggleFocus";
+ "ctrl-shift-t" = "workspace::NewTerminal";
+ };
+ }
+ {
+ context = "Editor";
+ bindings = {
+ "ctrl-d" = "editor::DeleteLine";
+ "ctrl-'" = "editor::ToggleComments";
+ };
+ }
+ ];
+
+ ## Extensions
+ extensions = [
+ "nix" # Nix
+ "dart" # Flutter/Dart
+ "java" # Java
+ "html" # HTML
+ "toml" # TOML
+ "dockerfile" # Docker
+ "make" # Makefiles
+ "sql" # SQL
+ "basher" # Bash
+ "latex" # LaTeX
+ "log" # Log Files
+ "git-firefly" # Git
+ "material-icon-theme" # File Icons
+ ];
+ };
+ };
+}
diff --git a/modules/desktop/_wm/style.nix b/modules/desktop/_wm/style.nix
@@ -35,11 +35,7 @@
theme = "${pkgs.custom.adw-catppuccin}/share/adw-catppuccin/macchiato";
# Use Catppuccin over Stylix
- alias = {
- qt = "kvantum";
- discord = "vesktop";
- zed = "zed-editor";
- };
+ alias = {qt = "kvantum";};
except = ["kitty"];
targets = filter (n: !hasPrefix "_" n) (attrNames options.stylix.targets);
derived = filter (t: elem (alias.${t} or t) (attrNames config.catppuccin) && !elem t except) targets;
diff --git a/modules/games/games.nix b/modules/games/games.nix
@@ -12,7 +12,7 @@ _: {
};
# Game Mode
- # ? # Use 'gamemoderun <command>'
+ #? Use 'gamemoderun <command>'
hardware.cpu.mode = lib.mkOverride 51 "performance";
programs.gamemode.enable = true;
hardware.steam-hardware.enable = true;
diff --git a/modules/games/mc-server/default.nix b/modules/games/mc-server/default.nix
@@ -1,6 +1,6 @@
## Minecraft Server Configuration ##
-# ? # Run 'systemctl start minecraft-server-NAME' to start the server
-# ? # Run 'echo COMMAND > /run/minecraft/NAME.stdin' to run commands
+#? Run 'systemctl start minecraft-server-NAME' to start the server
+#? Run 'echo COMMAND > /run/minecraft/NAME.stdin' to run commands
{inputs, ...}: {
flake.modules.nixos.mc-server = {
config,
diff --git a/modules/hosts/valkyrie/_asus/default.nix b/modules/hosts/valkyrie/_asus/default.nix
@@ -7,7 +7,7 @@ _: {
boot = {
plymouth.extraConfig = "DeviceScale=2";
- # ! # https://gitlab.freedesktop.org/drm/amd/-/issues/3388
+ #! https://gitlab.freedesktop.org/drm/amd/-/issues/3388
kernelParams = lib.mkIf (config.hardware.cpu.mode == "performance") [
"amdgpu.dcdebugmask=0x10"
"usbcore.autosuspend=-1"
diff --git a/modules/hosts/valkyrie/_vm/default.nix b/modules/hosts/valkyrie/_vm/default.nix
@@ -1,5 +1,5 @@
## Windows VM
-# ? # Run 'virsh -c qemu:///system start windows'
+#? Run 'virsh -c qemu:///system start windows'
{inputs}: {
nixos = {pkgs, ...}: {
imports = [inputs.nixvirt.nixosModules.default];
diff --git a/modules/hosts/valkyrie/default.nix b/modules/hosts/valkyrie/default.nix
@@ -21,16 +21,17 @@
hmModules = [
"secrets"
- "antigravity"
"auth"
- "discord"
- "firefox"
+ "syncthing"
"internet"
+ "firefox"
"notes"
+ "discord"
"spotify"
- "stream"
- "syncthing"
"vscode"
+ "antigravity"
+ "zed"
+ "stream"
"minecraft"
"osu"
];
diff --git a/modules/system/filesystem.nix b/modules/system/filesystem.nix
@@ -190,7 +190,7 @@ in {
};
# Reserved space
- # ? # Free with 'zfs set refreservation=none fspool/reserve'
+ #? Free with 'zfs set refreservation=none fspool/reserve'
"reserve" = {
type = "zfs_fs";
options = {
diff --git a/modules/system/security.nix b/modules/system/security.nix
@@ -2,22 +2,11 @@
{config, ...}: let
inherit (config.flake) files;
in {
- flake.modules.nixos.security = {
- lib,
- pkgs,
- ...
- }: {
+ flake.modules.nixos.security = {lib, ...}: {
config = {
security = {
protectKernelImage = false;
- # Sandbox
- apparmor = {
- enable = true;
- killUnconfinedConfinables = true;
- packages = [pkgs.apparmor-profiles];
- };
-
# Sudo
sudo = {
execWheelOnly = true;
@@ -26,7 +15,12 @@ in {
Defaults lecture = always, lecture_file = ${files.ascii.groot}
'';
};
+
+ # Sandbox
+ #! https://discourse.nixos.org/t/apparmor-on-nixos-roadmap/57217
+ apparmor.enable = false;
};
+ programs.firejail.enable = true;
# Recovery Account
specialisation.recovery.configuration = {
@@ -45,11 +39,8 @@ in {
};
};
- # Block Junk Sites
- networking.stevenblack.enable = true;
- programs.firejail.enable = true;
-
# Hardening
+ networking.stevenblack.enable = true; # Block Junk Sites
boot = {
# Kernel
kernelParams = [
diff --git a/modules/virt/android.nix b/modules/virt/android.nix
@@ -1,5 +1,5 @@
## Android Virtualisation ##
-# ? # Run 'waydroid init -s GAPPS -f' to install system image
+#? Run 'waydroid init -s GAPPS -f' to install system image
_: {
flake.modules.nixos.android = {
config,
diff --git a/modules/virt/docker.nix b/modules/virt/docker.nix
@@ -7,7 +7,7 @@ _: {
systemPackages = [pkgs.docker-compose];
};
- # ? # Use '--add-host=host.docker.internal:host-gateway' to create containers
+ #? Use '--add-host=host.docker.internal:host-gateway' to create containers
networking = {
firewall.trustedInterfaces = ["docker0"];
extraHosts = "127.0.0.1 host.docker.internal";
diff --git a/packages/overlays/copilot.nix b/packages/overlays/copilot.nix
@@ -1,10 +1,10 @@
final: prev: {
# GitHub Copilot CLI
github-copilot-cli = prev.github-copilot-cli.overrideAttrs (_: rec {
- version = "1.0.64";
+ version = "1.0.66";
src = prev.fetchurl {
url = "https://github.com/github/copilot-cli/releases/download/v${version}/github-copilot-${version}-linux-x64.tgz";
- hash = "sha256-p2I4BHdW9wRLP8ns7wmuWBwUW2RGOuARgDtItMovxGA=";
+ hash = "sha256-tCjaHF8ejYNXKO9ukXaHiW6J+a8r+l/WxYZrYZ/Whg4=";
};
});
}