wip: flake updates

This commit is contained in:
Jeremy Wall 2025-06-02 17:43:10 -04:00
parent d4fce72333
commit 876fa8fb33
7 changed files with 75 additions and 51 deletions

70
flake.lock generated
View File

@ -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": {

View File

@ -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" ];

View File

@ -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]);
}

View File

@ -1,6 +1,3 @@
let
lib = import ../lib/lib.nix;
in
{pkgs ? (import <nixpkgs>) {},
# 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/";
})
})

View File

@ -1,7 +0,0 @@
{
darwin-sdk = pkgs: with pkgs; (if stdenv.isDarwin then (with darwin.apple_sdk.frameworks; [
xcbuild
Security
fixDarwinDylibNames
]) else [ ]);
}

View File

@ -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;
}

View File

@ -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;