From ec75d13175b3697c20816c74b22bf5141475f2cf Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Tue, 22 Aug 2023 19:24:27 -0700 Subject: [PATCH] Use nightly in flake.nix build derivations --- flake.nix | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/flake.nix b/flake.nix index ecc8ed1..522ffd7 100644 --- a/flake.nix +++ b/flake.nix @@ -26,6 +26,20 @@ Updating `cargoHash`: pkgs = import nixpkgs { inherit system overlays; }; + # nightly is required for function signal syntax in leptos + # https://leptos-rs.github.io/leptos/02_getting_started.html + rust-bin = pkgs.rust-bin.nightly.latest.minimal; + rust-binWasm = rust-bin.override { + targets = [ "wasm32-unknown-unknown" ]; + }; + rustPlatform = pkgs.makeRustPlatform { + cargo = rust-bin; + rustc = rust-bin; + }; + rustPlatformWasm = pkgs.makeRustPlatform { + cargo = rust-binWasm; + rustc = rust-binWasm; + }; rustSettings = with pkgs; { src = ./.; cargoHash = nixpkgs.lib.fakeHash; @@ -38,10 +52,7 @@ Updating `cargoHash`: in { devShells.${system}.default = with pkgs; mkShell { packages = [ - # nightly is required for function signal syntax in leptos - # https://leptos-rs.github.io/leptos/02_getting_started.html - (pkgs.rust-bin.nightly.latest.default.override { - targets = [ "wasm32-unknown-unknown" ]; + (rust-binWasm.override { extensions = [ "rust-src" ]; }) bacon @@ -49,9 +60,8 @@ Updating `cargoHash`: inputsFrom = with self.packages.${system}; [ dyesub-tool dyesub-cli ]; }; packages.${system} = { - # TODO: use nightly default = self.packages.${system}.dyesub-cli; - dyesub-cli = pkgs.rustPlatform.buildRustPackage (rustSettings // { + dyesub-cli = rustPlatform.buildRustPackage (rustSettings // { pname = "dyesub-cli"; version = "0.1.0"; buildAndTestSubdir = "dyesub-cli"; @@ -60,7 +70,7 @@ Updating `cargoHash`: description = "A tool for generating dye sublimation transfer sheet SVGs for Japanese thumb shift 拇指シフト keycaps."; }; }); - dyesub-tool = pkgs.rustPlatform.buildRustPackage (rustSettings // { + dyesub-tool = rustPlatformWasm.buildRustPackage (rustSettings // { pname = "dyesub-tool"; version = "0.1.0"; buildAndTestSubdir = "dyesub-tool";