diff --git a/flake.lock b/flake.lock index e9a72b901..75786d1f8 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,26 @@ { "nodes": { + "fenix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src" + }, + "locked": { + "lastModified": 1721111394, + "narHash": "sha256-hCN0NCmqPdosiyGt2thVRqg9ltctTROzGAoMq57QXPs=", + "owner": "nix-community", + "repo": "fenix", + "rev": "e63599e3186cfb3284933bc815d33a509addd00e", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1720910238, @@ -17,8 +38,26 @@ }, "root": { "inputs": { + "fenix": "fenix", "nixpkgs": "nixpkgs" } + }, + "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1721048109, + "narHash": "sha256-X3tDuTPGKrAzTeQ9mkaGZL6srpsVEbZGW9PVdOLgfJo=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "0c95aaa08e5f870d269f0ca13010eda9a4dc3402", + "type": "github" + }, + "original": { + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 7b989766e..f3bdf78ab 100644 --- a/flake.nix +++ b/flake.nix @@ -3,14 +3,21 @@ nixpkgs = { url = "github:nixos/nixpkgs"; }; + fenix = { + url = "github:nix-community/fenix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = {nixpkgs, ...}: let + + outputs = { nixpkgs, fenix, ... }: let systems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"]; forAllSystems = nixpkgs.lib.genAttrs systems; in { devShells = forAllSystems ( system: let pkgs = nixpkgs.legacyPackages.${system}; + rustStable = fenix.packages.${system}.stable.toolchain; + wasmTarget = fenix.packages.${system}.targets.wasm32-wasi.latest.rust-std; in { default = with pkgs; mkShell { @@ -18,12 +25,11 @@ clang libiconv sqlite - rustup gnumake + rustup # not used to install the toolchain, but the makefile uses it + rustStable + wasmTarget ]; - shellHook = '' - rustup default stable - ''; }; } );