fix flake
This commit is contained in:
parent
8664f9d210
commit
201f0e5f0a
26 changed files with 536 additions and 2343 deletions
188
flake.nix
188
flake.nix
|
|
@ -46,95 +46,133 @@
|
|||
perSystem =
|
||||
{
|
||||
#config,
|
||||
#self',
|
||||
self',
|
||||
inputs',
|
||||
pkgs,
|
||||
#system,
|
||||
...
|
||||
}:
|
||||
{
|
||||
devenv.shells.default =
|
||||
let
|
||||
fnx = inputs'.fenix.packages;
|
||||
rustToolchain = fnx.combine [
|
||||
fnx.complete.cargo
|
||||
fnx.complete.clippy
|
||||
fnx.complete.rust-src
|
||||
fnx.complete.rustc
|
||||
fnx.complete.rustfmt
|
||||
fnx.targets.wasm32-unknown-unknown.latest.rust-std
|
||||
];
|
||||
let
|
||||
fnx = inputs'.fenix.packages;
|
||||
rustToolchain = fnx.combine [
|
||||
fnx.complete.cargo
|
||||
fnx.complete.clippy
|
||||
fnx.complete.rust-src
|
||||
fnx.complete.rustc
|
||||
fnx.complete.rustfmt
|
||||
fnx.targets.wasm32-unknown-unknown.latest.rust-std
|
||||
];
|
||||
|
||||
wasmBindgen =
|
||||
with pkgs;
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "wasm-bindgen-cli";
|
||||
version = "0.2.114";
|
||||
wasmBindgen =
|
||||
with pkgs;
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "wasm-bindgen-cli";
|
||||
version = "0.2.114";
|
||||
|
||||
src = fetchCrate {
|
||||
pname = pname;
|
||||
version = version;
|
||||
hash = "sha256-xrCym+rFY6EUQFWyWl6OPA+LtftpUAE5pIaElAIVqW0=";
|
||||
};
|
||||
|
||||
cargoDeps = rustPlatform.fetchCargoVendor {
|
||||
inherit src;
|
||||
inherit (src) pname version;
|
||||
hash = "sha256-Z8+dUXPQq7S+Q7DWNr2Y9d8GMuEdSnq00quUR0wDNPM=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
|
||||
buildInputs = [
|
||||
openssl
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
||||
curl
|
||||
];
|
||||
|
||||
nativeCheckInputs = [ nodejs_latest ];
|
||||
|
||||
# tests require it to be ran in the wasm-bindgen monorepo
|
||||
doCheck = false;
|
||||
};
|
||||
in
|
||||
{
|
||||
name = "my-project";
|
||||
|
||||
env = {
|
||||
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
|
||||
src = fetchCrate {
|
||||
pname = pname;
|
||||
version = version;
|
||||
hash = "sha256-xrCym+rFY6EUQFWyWl6OPA+LtftpUAE5pIaElAIVqW0=";
|
||||
};
|
||||
|
||||
packages = [
|
||||
pkgs.dioxus-cli
|
||||
pkgs.cargo-expand
|
||||
pkgs.cargo-deny
|
||||
pkgs.cargo-nextest
|
||||
pkgs.typos
|
||||
pkgs.binaryen # wasm-opt
|
||||
rustToolchain
|
||||
fnx.rust-analyzer
|
||||
wasmBindgen
|
||||
cargoDeps = rustPlatform.fetchCargoVendor {
|
||||
inherit src;
|
||||
inherit (src) pname version;
|
||||
hash = "sha256-Z8+dUXPQq7S+Q7DWNr2Y9d8GMuEdSnq00quUR0wDNPM=";
|
||||
};
|
||||
|
||||
pkgs.libxkbcommon
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
|
||||
buildInputs = [
|
||||
openssl
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
||||
curl
|
||||
];
|
||||
|
||||
scripts.checkall.exec = ''
|
||||
set -xeuo pipefail
|
||||
nativeCheckInputs = [ nodejs_latest ];
|
||||
|
||||
cargo clippy --workspace --all-targets --all-features -- -D warnings
|
||||
cargo deny check all -D warnings
|
||||
cargo fmt --all -- --check
|
||||
cargo nextest run --workspace --all-targets --all-features --status-level all --no-tests warn
|
||||
|
||||
# TODO Doctests
|
||||
|
||||
echo "==== checkall success ===="
|
||||
'';
|
||||
# DO NOT ENABLE RUST because devenv messes up the ability
|
||||
# to build rust-src
|
||||
# languages.rust = {};
|
||||
# tests require it to be ran in the wasm-bindgen monorepo
|
||||
doCheck = false;
|
||||
};
|
||||
in
|
||||
{
|
||||
packages.default = self'.packages.cursor-mover-app;
|
||||
|
||||
packages.cursor-mover-app =
|
||||
(pkgs.makeRustPlatform {
|
||||
cargo = rustToolchain;
|
||||
rustc = rustToolchain;
|
||||
}).buildRustPackage
|
||||
{
|
||||
pname = "cursor-mover-app";
|
||||
version = "0.1.0";
|
||||
|
||||
src = ./.;
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
wasmBindgen
|
||||
binaryen
|
||||
dioxus-cli
|
||||
breakpointHook
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
dx bundle --debug-symbols=false --release --web --package cursor-move-webapp
|
||||
'';
|
||||
|
||||
checkPhase = "";
|
||||
|
||||
installPhase = "
|
||||
mkdir -p $out/bin
|
||||
mkdir -p $out/share
|
||||
|
||||
cp -r target/dx/cursor-move-webapp/release/web $out/share/web
|
||||
|
||||
makeWrapper $out/share/web/cursor-move-webapp $out/bin/cursor-move-app --chdir $out/share/web
|
||||
";
|
||||
|
||||
cargoLock.lockFile = ./Cargo.lock;
|
||||
};
|
||||
|
||||
devenv.shells.default = {
|
||||
name = "my-project";
|
||||
|
||||
env = {
|
||||
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
|
||||
};
|
||||
|
||||
packages = [
|
||||
pkgs.dioxus-cli
|
||||
pkgs.cargo-expand
|
||||
pkgs.cargo-deny
|
||||
pkgs.cargo-nextest
|
||||
pkgs.typos
|
||||
pkgs.binaryen # wasm-opt
|
||||
rustToolchain
|
||||
fnx.rust-analyzer
|
||||
wasmBindgen
|
||||
|
||||
pkgs.libxkbcommon
|
||||
];
|
||||
|
||||
scripts.checkall.exec = ''
|
||||
set -xeuo pipefail
|
||||
|
||||
cargo clippy --workspace --all-targets --all-features -- -D warnings
|
||||
cargo deny check all -D warnings
|
||||
cargo fmt --all -- --check
|
||||
cargo nextest run --workspace --all-targets --all-features --status-level all --no-tests warn
|
||||
|
||||
# TODO Doctests
|
||||
|
||||
echo "==== checkall success ===="
|
||||
'';
|
||||
# DO NOT ENABLE RUST because devenv messes up the ability
|
||||
# to build rust-src
|
||||
# languages.rust = {};
|
||||
};
|
||||
|
||||
};
|
||||
flake = { };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue