nix: Fix gpu-lib/wayland binary patching on nix package (#16958)

Also, includes some cleanup -- adds missing flake-compat input and
aligns the nix build module with how nixpkgs does it.

Release Notes:

- Fixed an issue on NixOS package where the wrong binaries were being
patched, leading to missing Wayland libs when launching Zed
This commit is contained in:
jvmncs
2024-08-27 12:24:42 -04:00
committed by GitHub
parent 1f0b7d45ff
commit ff26abdc2f
3 changed files with 39 additions and 29 deletions
+9 -3
View File
@@ -11,7 +11,7 @@
url = "github:ipetkov/crane";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-compat.url = "github:edolstra/flake-compat";
};
outputs = {
@@ -32,8 +32,11 @@
in {
packages = forAllSystems (pkgs: let
craneLib = (crane.mkLib pkgs).overrideToolchain (p: p.fenix.stable.toolchain);
rustPlatform = pkgs.makeRustPlatform {
inherit (pkgs.fenix.stable.toolchain) cargo rustc;
};
nightlyBuild = pkgs.callPackage ./nix/build.nix {
inherit craneLib;
inherit craneLib rustPlatform;
};
in {
zed-editor = nightlyBuild;
@@ -46,9 +49,12 @@
formatter = forAllSystems (pkgs: pkgs.alejandra);
overlays.default = final: _prev: {
overlays.default = final: prev: {
zed-editor = final.callPackage ./nix/build.nix {
craneLib = (crane.mkLib final).overrideToolchain (p: p.fenix.stable.toolchain);
rustPlatform = final.makeRustPlatform {
inherit (final.fenix.stable.toolchain) cargo rustc;
};
};
};
};