generated from ElnuDev/rust-project
Use nightly in flake.nix build derivations
This commit is contained in:
parent
f5ab2ba353
commit
ec75d13175
1 changed files with 17 additions and 7 deletions
24
flake.nix
24
flake.nix
|
@ -26,6 +26,20 @@ Updating `cargoHash`:
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system overlays;
|
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; {
|
rustSettings = with pkgs; {
|
||||||
src = ./.;
|
src = ./.;
|
||||||
cargoHash = nixpkgs.lib.fakeHash;
|
cargoHash = nixpkgs.lib.fakeHash;
|
||||||
|
@ -38,10 +52,7 @@ Updating `cargoHash`:
|
||||||
in {
|
in {
|
||||||
devShells.${system}.default = with pkgs; mkShell {
|
devShells.${system}.default = with pkgs; mkShell {
|
||||||
packages = [
|
packages = [
|
||||||
# nightly is required for function signal syntax in leptos
|
(rust-binWasm.override {
|
||||||
# https://leptos-rs.github.io/leptos/02_getting_started.html
|
|
||||||
(pkgs.rust-bin.nightly.latest.default.override {
|
|
||||||
targets = [ "wasm32-unknown-unknown" ];
|
|
||||||
extensions = [ "rust-src" ];
|
extensions = [ "rust-src" ];
|
||||||
})
|
})
|
||||||
bacon
|
bacon
|
||||||
|
@ -49,9 +60,8 @@ Updating `cargoHash`:
|
||||||
inputsFrom = with self.packages.${system}; [ dyesub-tool dyesub-cli ];
|
inputsFrom = with self.packages.${system}; [ dyesub-tool dyesub-cli ];
|
||||||
};
|
};
|
||||||
packages.${system} = {
|
packages.${system} = {
|
||||||
# TODO: use nightly
|
|
||||||
default = self.packages.${system}.dyesub-cli;
|
default = self.packages.${system}.dyesub-cli;
|
||||||
dyesub-cli = pkgs.rustPlatform.buildRustPackage (rustSettings // {
|
dyesub-cli = rustPlatform.buildRustPackage (rustSettings // {
|
||||||
pname = "dyesub-cli";
|
pname = "dyesub-cli";
|
||||||
version = "0.1.0";
|
version = "0.1.0";
|
||||||
buildAndTestSubdir = "dyesub-cli";
|
buildAndTestSubdir = "dyesub-cli";
|
||||||
|
@ -60,7 +70,7 @@ Updating `cargoHash`:
|
||||||
description = "A tool for generating dye sublimation transfer sheet SVGs for Japanese thumb shift 拇指シフト keycaps.";
|
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";
|
pname = "dyesub-tool";
|
||||||
version = "0.1.0";
|
version = "0.1.0";
|
||||||
buildAndTestSubdir = "dyesub-tool";
|
buildAndTestSubdir = "dyesub-tool";
|
||||||
|
|
Loading…
Add table
Reference in a new issue