Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
While working through a problem, my colleague remembered a prior version of our application had a syntax example we could use. Thankfully, the codebase has been checked into git! We knew the code in question revolved around the mkDerivation functionality in nix.
Since then, this particular code has been moved out of our codebase and added to nixpkgs, so we can pull it from the main tree. My first instinct was to start digging through that (huge) repository to find the file and use that as a reference.
$ git show 3a275488e740ae1b4314208a908c5300f9563ee0 commit 3a275488e740ae1b4314208a908c5300f9563ee0 Author: David Yamnitsky Date: Mon Jul 19 11:51:47 2021 -0400 use mold and wasm-bindgen from nixpkgs ... flake. nix ───┐ 1: │ ───┘ { inputs = { nixpkgs = { url = "github:nixos/nixpkgs/nixos-unstable"; url = "github:nixos/nixpkgs/nixos-unstable-small"; }; flake-utils = { url = "github:numtide/flake-utils"; ────┐ 48: │ ────┘ CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER = toString ./. + "/scripts/clang"; CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_LINKER = "lld"; buildInputs = with pkgs; [ (stdenv.mkDerivation { pname = "mold"; version = "0.9.1"; src = fetchgit { url = "https://github.com/rui314/mold"; rev = "v0.9.1"; sha256 = "sha256-yIkW6OCXhlHZ1jC8/yMAdJbSgY9K40POT2zWv6wYr5E="; }; nativeBuildInputs = [ clang_12 cmake lld_12 tbb xxHash zlib openssl git ]; dontUseCmakeConfigure = "true"; buildPhase = "make -j $NIX_BUILD_CORES"; installPhase = "mkdir -p $out $out/bin $out/share/man/man1 && PREFIX=$out make install"; }) cachix cargo-insta clang_12