feat(nix): simplify flake.nix, remove devenv
This commit is contained in:
+11
-17
@@ -1,8 +1,6 @@
|
||||
{
|
||||
target,
|
||||
pkgs,
|
||||
nativeRustPlatform,
|
||||
windowsRustPlatform,
|
||||
...
|
||||
}: let
|
||||
cargoToml = fromTOML (builtins.readFile ../Cargo.toml);
|
||||
name = cargoToml.package.name;
|
||||
@@ -16,18 +14,14 @@
|
||||
meta = {
|
||||
inherit (cargoToml.package) description homepage;
|
||||
};
|
||||
postBuild = "${pkgs.upx}/bin/upx target/*/release/${name}${target.exeSuffix}";
|
||||
};
|
||||
nativeBuild =
|
||||
nativeRustPlatform.buildRustPackage buildArgs
|
||||
// {
|
||||
postBuild = "${pkgs.upx}/bin/upx target/*/release/${name}";
|
||||
};
|
||||
windowsBuild =
|
||||
windowsRustPlatform.buildRustPackage buildArgs
|
||||
// {
|
||||
postBuild = "${pkgs.upx}/bin/upx target/*/release/${name}.exe";
|
||||
};
|
||||
in {
|
||||
default = nativeBuild;
|
||||
windows = windowsBuild;
|
||||
}
|
||||
rustVersion = pkgs.rust-bin.stable.latest.default.override {
|
||||
targets = [target.triple];
|
||||
};
|
||||
rustPlatform = target.crossPkgs.makeRustPlatform {
|
||||
cargo = rustVersion;
|
||||
rustc = rustVersion;
|
||||
};
|
||||
in
|
||||
rustPlatform.buildRustPackage buildArgs
|
||||
|
||||
Reference in New Issue
Block a user