|
33 | 33 | extensions = [ "rust-analyzer" "rust-src" ]; |
34 | 34 | }; |
35 | 35 |
|
36 | | - # Pending an upstream Buck2 package we download pre-built system binaries. |
37 | | - # References: https://github.com/NixOS/nixpkgs/issues/226677 |
38 | | - buck2 = pkgs.stdenv.mkDerivation rec { |
39 | | - # These are the primary variables to control the "version" of Buck2 that we want from S3. |
40 | | - # |
41 | | - # To upload the latest objects and get the hashes needed for this flake, run the update |
42 | | - # script from the support directory via Buck2 itself. You can run that target again to |
43 | | - # find the hashes, even if the objects have already been uploaded. |
44 | | - |
45 | | - releaseDate = "2023-06-29"; |
46 | | - hash = { |
47 | | - "x86_64-linux" = "sha256-uCIbLPms8Ees8SYFZgMuDBKcd2AVdRES/AOzkuCbl1o="; |
48 | | - "aarch64-linux" = "sha256-2f1MOzw+maXlw75Qfd9YIOF4447PuU+seHHGOJ2als0="; |
49 | | - "x86_64-darwin" = "sha256-UFez/5wucCv54riuhsQKCw9EfyUW7xdacbYTVi9ZQ1U="; |
50 | | - "aarch64-darwin" = "sha256-pm9tf3aLllwq5ov3Fg9Umy25mpewGhBEjP5xSBzmFfQ="; |
51 | | - }.${system}; |
52 | | - |
53 | | - pname = "buck2"; |
54 | | - version = "unstable-${releaseDate}"; |
55 | | - |
56 | | - nativeBuildInputs = with pkgs; [ zstd ]; |
57 | | - |
58 | | - triple = { |
59 | | - "x86_64-linux" = "x86_64-unknown-linux-gnu"; |
60 | | - "aarch64-linux" = "aarch64-unknown-linux-gnu"; |
61 | | - "x86_64-darwin" = "x86_64-apple-darwin"; |
62 | | - "aarch64-darwin" = "aarch64-apple-darwin"; |
63 | | - }.${system}; |
64 | | - |
65 | | - urlPrefix = "https://buck2-binaries.s3.us-east-2.amazonaws.com/${releaseDate}"; |
66 | | - archiveName = "buck2-${triple}.zst"; |
67 | | - |
68 | | - src = pkgs.fetchurl { |
69 | | - url = "${urlPrefix}/${archiveName}"; |
70 | | - sha256 = hash; |
71 | | - }; |
72 | | - |
73 | | - unpackPhase = ":"; |
74 | | - sourceRoot = "."; |
75 | | - |
76 | | - installPhase = '' |
77 | | - mkdir -p $out/bin |
78 | | - zstd -d ${src} -o buck2 |
79 | | - install -m755 -D buck2 $out/bin/buck2 |
80 | | - ''; |
81 | | - |
82 | | - fixupPhase = if pkgs.stdenv.isLinux then '' |
83 | | - patchelf \ |
84 | | - --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ |
85 | | - $out/bin/buck2 |
86 | | - '' else |
87 | | - ""; |
88 | | - }; |
89 | | - |
90 | 36 | in with pkgs; { |
91 | 37 | devShells.default = mkShell { |
92 | 38 | packages = [ |
|
0 commit comments