···43 # procued by GitHub Actions. this also includes the hash for a download of a
44 # compatible buck2-prelude
45 buildHashes = builtins.fromJSON (builtins.readFile ./hashes.json);
04647 # map our platform name to the rust toolchain suffix
48- # NOTE (aseipp): must be synchronized with update.sh!
49 platform-suffix =
50 {
51 x86_64-darwin = "x86_64-apple-darwin";
···53 x86_64-linux = "x86_64-unknown-linux-gnu";
54 aarch64-linux = "aarch64-unknown-linux-gnu";
55 }
56- ."${stdenv.hostPlatform.system}";
57in
58stdenv.mkDerivation (finalAttrs: {
59 pname = "buck2";
···64 # zstd-compressed
65 (fetchurl {
66 url = "https://github.com/facebook/buck2/releases/download/${lib.removePrefix "unstable-" finalAttrs.version}/buck2-${platform-suffix}.zst";
67- hash = buildHashes."buck2-${stdenv.hostPlatform.system}";
68 })
69 # rust-project, which is used to provide IDE integration Buck2 Rust projects,
70 # is part of the official distribution
71 (fetchurl {
72 url = "https://github.com/facebook/buck2/releases/download/${lib.removePrefix "unstable-" finalAttrs.version}/rust-project-${platform-suffix}.zst";
73- hash = buildHashes."rust-project-${stdenv.hostPlatform.system}";
74 })
75 ];
76···124 # for downstream consumers to use when they need to automate any kind of
125 # tooling
126 prelude = fetchurl {
127- url = "https://github.com/facebook/buck2-prelude/archive/${buildHashes.prelude-git}.tar.gz";
128- hash = buildHashes.prelude-fod;
129 };
130131- updateScript = ./update.sh;
132 };
133134 meta = {
···43 # procued by GitHub Actions. this also includes the hash for a download of a
44 # compatible buck2-prelude
45 buildHashes = builtins.fromJSON (builtins.readFile ./hashes.json);
46+ archHashes = buildHashes.${stdenv.hostPlatform.system};
4748 # map our platform name to the rust toolchain suffix
49+ # NOTE (aseipp): must be synchronized with update.nu!
50 platform-suffix =
51 {
52 x86_64-darwin = "x86_64-apple-darwin";
···54 x86_64-linux = "x86_64-unknown-linux-gnu";
55 aarch64-linux = "aarch64-unknown-linux-gnu";
56 }
57+ .${stdenv.hostPlatform.system};
58in
59stdenv.mkDerivation (finalAttrs: {
60 pname = "buck2";
···65 # zstd-compressed
66 (fetchurl {
67 url = "https://github.com/facebook/buck2/releases/download/${lib.removePrefix "unstable-" finalAttrs.version}/buck2-${platform-suffix}.zst";
68+ hash = archHashes.buck2;
69 })
70 # rust-project, which is used to provide IDE integration Buck2 Rust projects,
71 # is part of the official distribution
72 (fetchurl {
73 url = "https://github.com/facebook/buck2/releases/download/${lib.removePrefix "unstable-" finalAttrs.version}/rust-project-${platform-suffix}.zst";
74+ hash = archHashes.rust-project;
75 })
76 ];
77···125 # for downstream consumers to use when they need to automate any kind of
126 # tooling
127 prelude = fetchurl {
128+ url = "https://github.com/facebook/buck2-prelude/archive/${buildHashes.preludeGit}.tar.gz";
129+ hash = buildHashes.preludeFod;
130 };
131132+ updateScript = ./update.nu;
133 };
134135 meta = {