Giter Club home page Giter Club logo

Comments (11)

urioTV avatar urioTV commented on June 26, 2024 3

You should note that just because it compiles does not mean it's ready. See https://github.com/zed-industries/zed/issues/7015

That's why I thought It would belong here because it's chaotic. Right now I'm fighting with rust development on Nix so I hope I will make it work :)

from nyx.

urioTV avatar urioTV commented on June 26, 2024 3

On https://aur.archlinux.org/packages/zed-editor I see that they managed to build it so I will test if it works now

from nyx.

urioTV avatar urioTV commented on June 26, 2024 2

So I guess It's a great opportunity to improve Nix knowledge because I've never done it before. I'll let you know when I manage to do it.

from nyx.

PedroHLC avatar PedroHLC commented on June 26, 2024 2

zed-industries/zed#7015

If it compiles, it looks enough to have it here 😄

from nyx.

urioTV avatar urioTV commented on June 26, 2024 1

Okay after some digging i have a good news and bad news. Good news is that (i think) I created working Nix expression to build it. Bad news is that it is not actually working but not because of me but there is an issue with linux build in general.

zed-industries/zed#7015 <---- there is current Linux support status.
https://aur.archlinux.org/packages/zed-editor <----- and there is AUR repo with exactly same problem that i have.

The problem is "protoc failed: Could not make proto path relative: protocol/livekit_room.proto: No such file or directory\n""
It seems that this livekit is not cross-platform so no linux support yet...

Anyway I want to send what I created with Nix and If someone want to bother I would really appreciate feedback.
I know that this code is probably terrible. However, it's encouraging to see that I reached the same moment as AUR.

Flake.nix

{
  description = "A flake for the Zed Code Editor";

  # Specifies the Nix flake inputs
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    flake-utils.url = "github:numtide/flake-utils";
  };

  # Utilizes flake-utils to simplify flake creation for multiple systems
  outputs = { self, nixpkgs, flake-utils, ... }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        pkgs = import nixpkgs {
          inherit system;
        };
        # Your package as a function that accepts nixpkgs as an argument
        zed = pkgs.callPackage ./default.nix { pkgs;};
      in
      {
        packages.zed = zed;
        defaultPackage = zed;
        devShell = pkgs.mkShell {
          nativeBuildInputs = [ pkgs.pkg-config ];
          buildInputs = [ zed pkgs.openssl ];
        };
      });
}

default.nix

{ lib, fetchFromGitHub, rustPlatform, nixpkgs, pkgs }:

rustPlatform.buildRustPackage rec {
  pname = "zed";
  version = "v0.122.2";

  src = fetchFromGitHub {
    owner = "zed-industries";
    repo = pname;
    rev = version;
    hash = "sha256-9yrlRhifOCSv++14ZHcKZCfLja3H2oc3Ttx3ltkLUvQ=";
  };

  cargoLock = {
    lockFile = "${src}/Cargo.lock";
    allowBuiltinFetchGit = true;
  };
  nativeBuildInputs = [ pkgs.pkg-config pkgs.wayland pkgs.cmake pkgs.fontconfig pkgs.alsa-lib pkgs.vulkan-validation-layers pkgs.libxkbcommon pkgs.protobuf ];
  buildInputs = [ pkgs.openssl pkgs.wayland pkgs.cmake pkgs.fontconfig pkgs.alsa-lib pkgs.vulkan-validation-layers pkgs.libxkbcommon pkgs.protobuf ];


  meta = with lib; {
    description = "Zed Code Editor";
    homepage = "https://zed.dev";
    license = licenses.unlicense;
    maintainers = [];
  };
}

from nyx.

wyndon avatar wyndon commented on June 26, 2024 1

FYI, Zed has been merged in nixpkgs : NixOS/nixpkgs#284010

from nyx.

PedroHLC avatar PedroHLC commented on June 26, 2024

It has a Cargo.lock, and by looking at the Dockerfile cargo is all it needs to build (and libcurl).

If you can make it work with buildRustPackage, post the code here. And then I'll make sure it builds a fresh version every day.

from nyx.

Technetium1 avatar Technetium1 commented on June 26, 2024

You should note that just because it compiles does not mean it's ready. See https://github.com/zed-industries/zed/issues/7015

from nyx.

urioTV avatar urioTV commented on June 26, 2024

Okay so I had some progress. I managed to build Livekit Protocol from source with this.

{ lib, fetchFromGitHub, pkgs, buildGoModule }:

buildGoModule rec {
  pname = "protocol";
  version = "a2f6423fd17cb73d1b19a1161f2daa7869f1391d";

  src = fetchFromGitHub {
    owner = "livekit";
    repo = pname;
    rev = version;
    hash = "sha256-2NzCBIDbm8PiDHjDiQEEH1p+CxMvRzinM0hnyAG+kgE=";
  };

  vendorHash = "sha256-fBGJjeXJa8Wtx1yTO56r+3tm+6IPoG+4Vh0TRORwzsQ=";

  

  meta = with lib; {
    description = "Livekit Protocol";
    homepage = "https://github.com/livekit/protocol/";
    license = licenses.unlicense;
    maintainers = [];
  };
}

PKGBUILD from aur replaces default Livekit with the one built from source(If I understand it correctly). So I guess the only thing to do is to replace it in default.nix file... but I have no idea how to do it right now.

On aur they do something like this

cd "$_archive"
rm -r crates/live_kit_server/protocol
ln -sT "$srcdir/protocol-${_tags[protocol]}" crates/live_kit_server/protocol

I already have this protocol built but I don't know how to use it to replace this crates/live_kit_server/protocol file.

If someone could help I'll be glad but I will still investigate it in my free-time.

from nyx.

PedroHLC avatar PedroHLC commented on June 26, 2024

I need to rewrite my generic git update script to properly account cargo hashes, maven hashes, and Cargo lock bumps.

from nyx.

PedroHLC avatar PedroHLC commented on June 26, 2024

Done. Going to bump the hashes by hand, but rust compilation is slow so it will take some time to cache.

from nyx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.