feat(nix): remove devenv, build backend with nix

This commit is contained in:
2026-05-10 15:57:12 +02:00
parent aaf82e3a5c
commit fd00d1925b
7 changed files with 93 additions and 310 deletions

24
nix/backend.nix Normal file
View File

@@ -0,0 +1,24 @@
target: let
cargoToml = fromTOML (builtins.readFile ../backend/Cargo.toml);
inherit (cargoToml.package) name version;
pkgs = target.crossPkgs;
buildArgs = {
pname = name;
inherit version;
src = pkgs.lib.cleanSource ../.;
cargoLock.lockFile = ../Cargo.lock;
useNextest = true;
meta = {
inherit (cargoToml.package) description homepage;
};
postBuild = "${pkgs.upx}/bin/upx target/*/release/*${name}";
};
rustVersion = pkgs.rust-bin.stable.latest.default.override {
targets = [target.triple];
};
rustPlatform = target.crossPkgs.makeRustPlatform {
cargo = rustVersion;
rustc = rustVersion;
};
in
rustPlatform.buildRustPackage buildArgs