Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve flake.nix #26277

Open
1 of 13 tasks
P1n3appl3 opened this issue Mar 7, 2025 · 0 comments
Open
1 of 13 tasks

Improve flake.nix #26277

P1n3appl3 opened this issue Mar 7, 2025 · 0 comments
Assignees
Labels
nix Nix configuration support tracking Issue that tracks a group of related issues

Comments

@P1n3appl3
Copy link
Contributor

P1n3appl3 commented Mar 7, 2025

Important

this issue only tracks issues with our in-tree flake and users' ability to build zed, for other issues with using the editor on nixos such as:

... you should check the nix label in our issues and file a new issue instead of bringing it up here

Progress

The following table tracks what functionality is known to be working on each platform. All listed commands are run inside the devshell.

x86 nixos arm nixos x86 linux arm linux arm darwin
cargo run 1 1 1
cargo nextest r --workspace 1 1 1 ⚠️
nix run github:zed-industries/zed 🚧 1 1 1 🚧
cargo r -p remote_server 1 1 1
cargo r -p collab 1 1 1
remote server nix build
collab server nix build
collab server nixos module 🚫 🚫 🚫
all tests pass in nix sandbox
script/bundle-<linux/mac> 🚫 🚫

key:

🚧 ⚠️ 🚫
working in progress unknown, maybe working broken not planned not started yet

Context

  • nixpkgs has an independently maintained package that is being kept up to date and working by some volunteers
    • we'd like to collaborate with them so they don't have to bend over backwards to package zed
  • we have two main priorities for the in-tree flake
    • keep the devshell working as a developer environment for all platforms. try to make sure that users can build zed, remote servers, and the collab server, as well as having all tests pass with no system-level dependencies
    • working build to make a nightly version of zed easily available (nix run github:zed-industries/zed)

Known issues

  • cargo about doesn't work with crane's cargoVendorDeps (see this comment). Fix nix build #26270 adds a flag to prevent it from causing installPhase to fail, but we'd like to have a better solution eventually.
  • craneLib.buildDepsOnly isn't working. Fix nix build #26270 disables it, but fixing it would be nice for caching/build times.

Roadmap

  • push builds to cachix (or use garnix?): Setup cachix #19937
    • run a nix build in CI or nightly: Build nix flake in CI #17458
      • building in CI may be too slow at the moment, especially without magic-nix-cache and craneLib.buildDepsOnly
      • as a compromise we could possibly trigger nix CI runs on PRs with that touch builds/bundling/the flake itself using the nix label
      • if we go with nightly triggered builds @P1n3appl3 will have to figure out how to monitor it herself
    • get ownership of the existing zed-industries cachix
    • add it as a substitutor in our flake
  • update https://zed.dev/docs/linux with instructions for using the nightly build
  • split reomte server into its own derivation
    • use musl/pkgsStatic to build a static one for linux
  • upstream a knob to webrtc-sys to control static/dynamic linking OR write a static package for it
  • upstream our cargo bundle changes and stop building a custom version of it
  • add an optional FHSenv that supports the downloaded binaries of popular language servers
    • I'm on the fence about whether we want to provide this
    • another potential solution is improving the extension API to allow prevention of downloading binaries and making sure they pick up existing ones on your $PATH
    • some existing docs advise using nix-ld for this, I don't know whether that's a better or worse experience than an FHSenv (maybe depends on whether you end up needing to add additional packages to the FHSenv)
  • build collab server with nix (another separate output)
  • provide nixos module for running the collab server
  • add crane rustdoc output with private items and doctests if possible

Footnotes

  1. Should have been fixed in Fix nix build #26270, need someone on those platforms to verify 2 3 4 5 6 7 8 9 10 11 12 13 14 15

@P1n3appl3 P1n3appl3 added nix Nix configuration support tracking Issue that tracks a group of related issues labels Mar 7, 2025
@P1n3appl3 P1n3appl3 self-assigned this Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nix Nix configuration support tracking Issue that tracks a group of related issues
Projects
None yet
Development

No branches or pull requests

1 participant