Compare commits

..
Author SHA1 Message Date
8a72f86ffc Update Rust crate aes-gcm to 0.11
Some checks failed
renovate/stability-days Updates have met minimum release age requirement
CI / checks (pull_request) Failing after 2m36s
2026-08-27 23:01:18 +03:00
8d94bc5498
feat(qol): add direnv
Some checks failed
CI / checks (push) Failing after 3m14s
2026-08-27 21:55:36 +02:00
22d13742ae
feat(qol): remove dup
Some checks failed
CI / checks (push) Failing after 4m44s
2026-08-27 21:10:37 +02:00
3 changed files with 43 additions and 26 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use flake

1
.gitignore vendored
View file

@ -6,3 +6,4 @@ dist/
*.tgz
wasm/pkg/
web_client/
.direnv

View file

@ -5,26 +5,30 @@
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = {
self,
nixpkgs,
rust-overlay,
}: let
systems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
eachSystem = f:
nixpkgs.lib.foldl' nixpkgs.lib.recursiveUpdate {} (
map (system: nixpkgs.lib.mapAttrs (_: value: {${system} = value;}) (f system)) systems
);
in
outputs =
{
self,
nixpkgs,
rust-overlay,
}:
let
systems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
eachSystem =
f:
nixpkgs.lib.foldl' nixpkgs.lib.recursiveUpdate { } (
map (system: nixpkgs.lib.mapAttrs (_: value: { ${system} = value; }) (f system)) systems
);
in
eachSystem (
system: let
overlays = [rust-overlay.overlays.default];
pkgs = import nixpkgs {inherit system overlays;};
system:
let
overlays = [ rust-overlay.overlays.default ];
pkgs = import nixpkgs { inherit system overlays; };
rustToolchain = pkgs.rust-bin.stable.latest.default.override {
extensions = [
@ -32,12 +36,12 @@
"clippy"
"rustfmt"
];
targets = ["wasm32-unknown-unknown"];
targets = [ "wasm32-unknown-unknown" ];
};
clippyCheck = pkgs.writeShellApplication {
name = "mtp-clippy";
runtimeInputs = [rustToolchain];
runtimeInputs = [ rustToolchain ];
text = ''
export MTP_TYPE_MAPS="''${MTP_TYPE_MAPS:-$PWD/example/type-maps.yaml}"
cargo clippy --workspace --exclude mtp-wasm --all-targets --all-features -- -D warnings -W unreachable-pub
@ -46,7 +50,7 @@
macheteCheck = pkgs.writeShellApplication {
name = "mtp-machete";
runtimeInputs = [pkgs.cargo-machete];
runtimeInputs = [ pkgs.cargo-machete ];
text = ''
cargo machete "$@"
'';
@ -54,7 +58,15 @@
buildAll = pkgs.writeShellApplication {
name = "mtp-build-all";
runtimeInputs = [rustToolchain pkgs.cargo-deny pkgs.wasm-pack pkgs.pnpm pkgs.coreutils clippyCheck macheteCheck];
runtimeInputs = [
rustToolchain
pkgs.cargo-deny
pkgs.wasm-pack
pkgs.pnpm
pkgs.coreutils
clippyCheck
macheteCheck
];
text = ''
export MTP_TYPE_MAPS="''${MTP_TYPE_MAPS:-$PWD/example/type-maps.yaml}"
@ -66,7 +78,6 @@
cargo check --manifest-path example/Cargo.toml --workspace --all-targets --all-features
mtp-clippy
mtp-machete
pnpm run dup
pnpm run build
RUSTFLAGS="--cfg web_sys_unstable_apis" wasm-pack test --node wasm
pnpm run test:e2e
@ -79,13 +90,17 @@
healthCheck = pkgs.writeShellApplication {
name = "mtp-health";
runtimeInputs = [clippyCheck macheteCheck];
runtimeInputs = [
clippyCheck
macheteCheck
];
text = ''
mtp-clippy
mtp-machete
'';
};
in {
in
{
devShells = {
default = pkgs.mkShell {
name = "mtp-dev";