feat(nix): simplify flake.nix, remove devenv

This commit is contained in:
2026-04-26 21:49:15 +02:00
parent 412a056e70
commit 6a702ec205
5 changed files with 101 additions and 333 deletions
+11 -17
View File
@@ -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
+17 -24
View File
@@ -1,31 +1,24 @@
{
inputs,
pkgs,
rustVersion,
...
}:
inputs.devenv.lib.mkShell {
inherit inputs pkgs;
modules = [
{
packages = with pkgs; [
(rustVersion.override {
extensions = [
"clippy"
"rust-src"
"rust-analyzer"
"rustfmt"
];
})
bacon
cargo-deny
cargo-edit
cargo-nextest
cargo-tarpaulin
git-cliff
just
typos
pkgs.mkShell {
packages = with pkgs; [
(rustVersion.override {
extensions = [
"clippy"
"rust-src"
"rust-analyzer"
"rustfmt"
];
}
})
bacon
cargo-deny
cargo-edit
cargo-nextest
cargo-tarpaulin
git-cliff
just
typos
];
}