From 876fa8fb33c49847173e177e669b36d49a2621cf Mon Sep 17 00:00:00 2001 From: Jeremy Wall Date: Mon, 2 Jun 2025 17:43:10 -0400 Subject: [PATCH] wip: flake updates --- flake.lock | 70 ++++++++++++++++++++++++++++-------- flake.nix | 22 ++++++------ nix/devShell/default.nix | 5 +-- nix/kitchen/default.nix | 7 ++-- nix/lib/lib.nix | 7 ---- nix/wasm-bindgen/default.nix | 10 +++--- nix/wasm-pack/default.nix | 5 +-- 7 files changed, 75 insertions(+), 51 deletions(-) delete mode 100644 nix/lib/lib.nix diff --git a/flake.lock b/flake.lock index fc6e540..3cad5b0 100644 --- a/flake.lock +++ b/flake.lock @@ -16,6 +16,28 @@ "type": "github" } }, + "fenix": { + "inputs": { + "nixpkgs": [ + "naersk", + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src" + }, + "locked": { + "lastModified": 1752475459, + "narHash": "sha256-z6QEu4ZFuHiqdOPbYss4/Q8B0BFhacR8ts6jO/F/aOU=", + "owner": "nix-community", + "repo": "fenix", + "rev": "bf0d6f70f4c9a9cf8845f992105652173f4b617f", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { @@ -65,14 +87,15 @@ }, "naersk": { "inputs": { + "fenix": "fenix", "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1671096816, - "narHash": "sha256-ezQCsNgmpUHdZANDCILm3RvtO1xH8uujk/+EqNvzIOg=", + "lastModified": 1752689277, + "narHash": "sha256-uldUBFkZe/E7qbvxa3mH1ItrWZyT6w1dBKJQF/3ZSsc=", "owner": "nix-community", "repo": "naersk", - "rev": "d998160d6a076cfe8f9741e56aeec7e267e3e114", + "rev": "0e72363d0938b0208d6c646d10649164c43f4d64", "type": "github" }, "original": { @@ -83,25 +106,27 @@ }, "nixpkgs": { "locked": { - "lastModified": 1678987615, - "narHash": "sha256-lF4agoB7ysQGNHRXvOqxtSKIZrUZwClA85aASahQlYM=", + "lastModified": 1752077645, + "narHash": "sha256-HM791ZQtXV93xtCY+ZxG1REzhQenSQO020cu6rHtAPk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "194c2aa446b2b059886bb68be15ef6736d5a8c31", + "rev": "be9e214982e20b8310878ac2baa063a961c1bdf6", "type": "github" }, "original": { - "id": "nixpkgs", - "type": "indirect" + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" } }, "nixpkgs_2": { "locked": { - "lastModified": 1719152388, - "narHash": "sha256-pHg0nzAa2ZM+zFamfsY7ZvVaB19pMr5wl4G5nO0J7eU=", + "lastModified": 1753135609, + "narHash": "sha256-//xMo8MwSw1HoTnIk455J7NIJpsDqwVyD69MOXb7gZM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "be54c7d931a68ba6a79f097ce979288e90a74288", + "rev": "5d9316e7fb2d6395818d506ef997530eba1545b7", "type": "github" }, "original": { @@ -121,6 +146,23 @@ "rust-overlay": "rust-overlay" } }, + "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1752428706, + "narHash": "sha256-EJcdxw3aXfP8Ex1Nm3s0awyH9egQvB2Gu+QEnJn2Sfg=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "591e3b7624be97e4443ea7b5542c191311aa141d", + "type": "github" + }, + "original": { + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" + } + }, "rust-overlay": { "inputs": { "nixpkgs": [ @@ -128,11 +170,11 @@ ] }, "locked": { - "lastModified": 1718681902, - "narHash": "sha256-E/T7Ge6ayEQe7FVKMJqDBoHyLhRhjc6u9CmU8MyYfy0=", + "lastModified": 1750964660, + "narHash": "sha256-YQ6EyFetjH1uy5JhdhRdPe6cuNXlYpMAQePFfZj4W7M=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "16c8ad83297c278eebe740dea5491c1708960dd1", + "rev": "04f0fcfb1a50c63529805a798b4b5c21610ff390", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 7f1a067..884011c 100644 --- a/flake.nix +++ b/flake.nix @@ -2,16 +2,16 @@ description = "kitchen"; # Pin nixpkgs inputs = { - nixpkgs.url = "github:NixOS/nixpkgs"; - gitignore = { url = "github:hercules-ci/gitignore.nix"; flake = false; }; - flake-utils.url = "github:numtide/flake-utils"; - rust-overlay = { - url = "github:oxalica/rust-overlay?ref=stable"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - naersk.url = "github:nix-community/naersk"; - flake-compat = { url = "github:edolstra/flake-compat"; flake = false; }; - cargo-wasm2map-src = { url = "github:mtolmacs/wasm2map"; flake = false; }; + nixpkgs.url = "github:NixOS/nixpkgs"; + gitignore = { url = "github:hercules-ci/gitignore.nix"; flake = false; }; + flake-utils.url = "github:numtide/flake-utils"; + rust-overlay = { + url = "github:oxalica/rust-overlay?ref=stable"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + naersk.url = "github:nix-community/naersk"; + flake-compat = { url = "github:edolstra/flake-compat"; flake = false; }; + cargo-wasm2map-src = { url = "github:mtolmacs/wasm2map"; flake = false; }; }; outputs = {nixpkgs, flake-utils, rust-overlay, naersk, cargo-wasm2map-src, ...}: let @@ -26,7 +26,7 @@ let overlays = [ rust-overlay.overlays.default ]; pkgs = import nixpkgs { inherit system overlays; }; - rust-wasm = pkgs.rust-bin.stable."1.77.0".default.override { + rust-wasm = pkgs.rust-bin.stable."1.87.0".default.override { extensions = [ "rust-src" ]; # Add wasm32 as an extra target besides the native target. targets = [ "wasm32-unknown-unknown" ]; diff --git a/nix/devShell/default.nix b/nix/devShell/default.nix index 9ffb60d..06a35f9 100644 --- a/nix/devShell/default.nix +++ b/nix/devShell/default.nix @@ -1,8 +1,5 @@ -let - lib = import ../lib/lib.nix; -in { pkgs, rust-wasm, wasm-pack-hermetic, wasm-bindgen, cargo-wasm2map }: with pkgs; mkShell { - buildInputs = (lib.darwin-sdk pkgs) ++ (with pkgs; [wasm-bindgen wasm-pack-hermetic llvm clang rust-wasm binaryen cargo-wasm2map]); + buildInputs = (with pkgs; [wasm-bindgen wasm-pack-hermetic llvm clang rust-wasm binaryen cargo-wasm2map]); } diff --git a/nix/kitchen/default.nix b/nix/kitchen/default.nix index 691bd01..4de7a35 100644 --- a/nix/kitchen/default.nix +++ b/nix/kitchen/default.nix @@ -1,6 +1,3 @@ -let - lib = import ../lib/lib.nix; -in {pkgs ? (import ) {}, # Because it's a workspace we need the other crates available as source root, @@ -15,7 +12,7 @@ with pkgs; inherit version; buildInputs = [ rust-wasm libclang ]; # However the crate we are building has it's root in specific crate. - nativeBuildInputs = (lib.darwin-sdk pkgs) ++ [llvm clang rust-bindgen]; + nativeBuildInputs = [llvm clang rust-bindgen]; src = root; cargoBuildOptions = opts: opts ++ ["-p" "${pname}" ]; postPatch = '' @@ -25,4 +22,4 @@ with pkgs; ''; # We have to tell libproc where the libclang.dylib lives LIBCLANG_PATH="${libclang.lib}/lib/"; -}) \ No newline at end of file +}) diff --git a/nix/lib/lib.nix b/nix/lib/lib.nix deleted file mode 100644 index 378f147..0000000 --- a/nix/lib/lib.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - darwin-sdk = pkgs: with pkgs; (if stdenv.isDarwin then (with darwin.apple_sdk.frameworks; [ - xcbuild - Security - fixDarwinDylibNames - ]) else [ ]); -} \ No newline at end of file diff --git a/nix/wasm-bindgen/default.nix b/nix/wasm-bindgen/default.nix index 14b4d18..36651ea 100644 --- a/nix/wasm-bindgen/default.nix +++ b/nix/wasm-bindgen/default.nix @@ -1,6 +1,3 @@ -let - my-lib = import ../lib/lib.nix; -in { pkgs , lib , rustPlatform @@ -25,14 +22,15 @@ rustPlatform.buildRustPackage rec { sha256 = "sha256-IPxP68xtNSpwJjV2yNMeepAS0anzGl02hYlSTvPocz8="; }; - cargoSha256 = "sha256-pBeQaG6i65uJrJptZQLuIaCb/WCQMhba1Z1OhYqA8Zc="; + cargoHash = "sha256-EsGFW1f9+E5NnMadP/0rRzFCxVJQb0mlTLz/3zYQ5Ac="; nativeBuildInputs = [ pkg-config ]; - buildInputs = [ openssl curl ] ++ (my-lib.darwin-sdk pkgs); + buildInputs = [ openssl curl ]; nativeCheckInputs = [ nodejs ]; # other tests require it to be ran in the wasm-bindgen monorepo - cargoTestFlags = [ "--test=reference" ]; + #cargoTestFlags = [ "--test=reference" ]; + doCheck = false; } diff --git a/nix/wasm-pack/default.nix b/nix/wasm-pack/default.nix index e43b837..5d77e54 100644 --- a/nix/wasm-pack/default.nix +++ b/nix/wasm-pack/default.nix @@ -1,6 +1,3 @@ -let - my-lib = import ../lib/lib.nix; -in {pkgs, naersk-lib, rust-wasm, @@ -10,7 +7,7 @@ with pkgs; pname = "wasm-pack"; version = "v0.12.1"; buildInputs = [ rust-wasm pkgs.openssl curl]; - nativeBuildInputs = (my-lib.darwin-sdk pkgs) ++ [llvm clang pkg-config]; + nativeBuildInputs =[llvm clang pkg-config]; OPENSSL_NO_VENDOR=1; # The checks use network so disable them here doCheck = false;