This repository provides a Nix flake for the Zed Editor, a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
This flake provides the following packages:
zed-editor: Built from source version of the latest stable releasezed-editor-bin: Pre-built binaries from upstream of the latest stable releasezed-editor-fhs: FHS-compatible environment forzed-editorzed-editor-bin-fhs: FHS-compatible environment forzed-editor-binzed-editor-preview: Built from source version of the latest preview releasezed-editor-preview-bin: Pre-built binaries from upstream of the latest preview releasezed-editor-preview-fhs: FHS-compatible environment forzed-editor-previewzed-editor-preview-bin-fhs: FHS-compatible environment forzed-editor-preview-bin
You can run the editor directly without installing it:
# Latest stable release (built from source)
nix run github:HPsaucii/zed-editor-flake
# Latest stable release (pre-built binary)
nix run github:HPsaucii/zed-editor-flake#zed-editor-bin
# Latest stable release in an FHS environment
nix run github:HPsaucii/zed-editor-flake#zed-editor-fhs
# Latest preview release (built from source)
nix run github:HPsaucii/zed-editor-flake#zed-editor-preview
# Latest preview release (pre-built binary)
nix run github:HPsaucii/zed-editor-flake#zed-editor-preview-binIn your flake.nix:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
zed-editor-flake.url = "github:HPsaucii/zed-editor-flake";
};
outputs = { self, nixpkgs, zed-editor-flake, ... }:
let
# Example for a single system
system = "x86_64-linux"; # Or "aarch64-linux", "x86_64-darwin", "aarch64-darwin"
pkgs = nixpkgs.legacyPackages.${system};
in
{
# Example for NixOS configuration
nixosConfigurations.yourHostname = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
({ config, pkgs, ... }: {
environment.systemPackages = [
zed-editor-flake.packages.${system}.zed-editor # Or zed-editor-bin, zed-editor-preview, etc.
];
})
];
};
# Example for home-manager configuration
homeConfigurations.yourUsername = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
{
home.packages = [
zed-editor-flake.packages.${system}.zed-editor # Or zed-editor-bin, zed-editor-preview, etc.
];
}
];
};
};
}This repository uses GitHub Actions to automatically check for new Zed Editor releases (both stable and preview) and update the corresponding Nix packages.
The automated update workflow performs the following steps:
- Checks for new releases: On a schedule (Monday and Thursday at 12:00 UTC) or when manually triggered, the workflow checks the Zed Editor GitHub repository for the latest stable and preview releases.
- Updates package versions: If new versions are found, the
versionattribute is updated in thedefault.nixfiles for:zed-editorandzed-editor-bin(for stable releases)zed-editor-previewandzed-editor-preview-bin(for preview releases)
- Updates source hashes: The source tarball hash (
hash) is updated for:zed-editor(for stable releases)zed-editor-preview(for preview releases)
- Updates binary hashes: The pre-built binary hashes (
sha256) for each supported system are updated for:zed-editor-bin(for stable releases)zed-editor-preview-bin(for preview releases)
- Updates Cargo hashes: The
cargoHash(for vendored dependencies) is updated for:zed-editor(for stable releases)zed-editor-preview(for preview releases)
- Updates flake lock file:
nix flake updateis run to refresh theflake.lockfile. - Creates a pull request: A pull request is automatically created with all the changes, detailing the versions updated and the new hashes.
You can manually trigger the update workflow through the GitHub Actions interface:
- Navigate to the "Actions" tab in the repository.
- Select the "Update Zed Editor Packages" workflow from the sidebar.
- Click the "Run workflow" dropdown button.
- Optionally, you can:
- Specify a Specific stable version to update to (e.g.,
0.180.0). - Specify a Specific preview version to update to (e.g.,
0.181.0-pre). - Check Force check for updates to run the update process even if the latest fetched version matches the current version in the flake (useful for re-calculating hashes if a release asset was changed upstream).
- Specify a Specific stable version to update to (e.g.,
- Click "Run workflow".
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request. Please feel free to submit a pull request.