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
4 changed files with 44 additions and 27 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use flake

1
.gitignore vendored
View file

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

View file

@ -8,7 +8,7 @@ ignored = ["rand_core"]
[dependencies] [dependencies]
chacha20poly1305 = { version = "0.10", optional = true } chacha20poly1305 = { version = "0.10", optional = true }
aes-gcm = { version = "0.10", optional = true } aes-gcm = { version = "0.11", optional = true }
ed25519-dalek = { version = "3.0", optional = true, features = [ ed25519-dalek = { version = "3.0", optional = true, features = [
"pkcs8", "pkcs8",
"pem", "pem",

View file

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